因此,我正在尝试使用来自本站点的IDE的非模块化指令在Apache Netbeans 11.1中构建一个简单的JavaFX应用程序: https://openjfx.io/openjfx-docs/
我正在使用JDK 13和JavaFX 13。
这些说明会一直工作到告诉您修改“属性->运行”下的VM选项为止。我按照指示添加了--module-path
和--add-modules
参数,但仍然出现错误:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 0 seconds)
使用工具->选项-> Java-> Ant将蚂蚁设置为详细,将详细级别设置为详细。 输出详细:
Detected Java version: 13 in: D:\Programs\JavaStuff\jdk-13
Detected OS: Windows 10
Trying to override old definition of task java
Trying to override old definition of task input
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
Trying to override old definition of task javac
Trying to override old definition of task delete
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
parsing buildfile C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml with URI = file:/C:/Users/BLAHBLAH/AppData/Local/NetBeans/Cache/11.1/executor-snippets/run.xml
Project base dir set to: C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets
Build sequence for target(s) `run' is [-init-paths, -init-macrodef-java-with-modules, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-modules, run]
Complete build sequence is [-init-paths, -init-macrodef-java-with-modules, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-modules, run, ]
-init-paths:
Override ignored for property "run.jvmargs"
Override ignored for property "work.dir"
Override ignored for property "application.args"
-init-macrodef-java-with-modules:
Skipped because property 'named.module.internal' not set.
-init-macrodef-java-with-unnamed-module:
creating macro call-java
-init-macrodef-java-without-modules:
Skipped because property 'modules.supported.internal' set.
run:
Executing 'D:\Programs\JavaStuff\jdk-13\bin\java.exe' with arguments:
'-Dfile.encoding=UTF-8'
'--module-path=D:\Programs\JavaStuff\javafx-sdk-13\lib\'
'--add-modules=javafx.controls,javafx.fxml'
'-classpath'
'D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx-swt.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.base.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.controls.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.fxml.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.graphics.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.media.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.swing.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.web.jar;C:\Users\BLAHBLAH\OneDrive\Documents\NetBeansProjects\HelloFX1\build\classes'
'--module-path'
'C:\Users\BLAHBLAH\OneDrive\Documents\NetBeansProjects\HelloFX1\build\classes'
'hellofx.HelloFX'
The ' characters around the executable and arguments are
not part of the command.
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:68: Java returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:566)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
BUILD FAILED (total time: 0 seconds)
有什么想法吗?
答案 0 :(得分:0)
我很感谢收到的答复-他们帮助我为自己,我的同事和我的学生进行了更多的研究并详尽地记录了解决方案。
因此,我希望这对尝试安装OpenJDK,NetBeans 11.1,OpenJFX(Open JavaFX)和Scene Builder时遇到类似错误和问题的其他人有所帮助。
我将PDF和我在所述PDF中引用的示例项目上载到以下存储库:
https://github.com/profjpbaugh/apache-netbeans-openjdk-openjfx
谢谢!