Javafx 18.0.1与Intellij配对,这给了我一个错误。 java.lang.module.findexception:Module com.example.hellofx找不到

发布于 2025-02-12 11:46:52 字数 1704 浏览 0 评论 0原文

我正在尝试添加VM选项,但是当我这样做时,我会遇到此错误。我目前正在使用MAVEN与Windows 10 64X上的Intellij和Javafx 18.0.1的当前版本一起使用。

"C:\Program Files\Amazon Corretto\jdk11.0.15_9\bin\java.exe" --module-path C:\Users\tommy\Documents\Javafx\openjfx-18.0.1_windows-x64_bin-sdk\javafx-sdk-18.0.1\lib --add-modules javafx.controls,javafx.fxml "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\lib\idea_rt.jar=54563:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\tommy\.m2\repository\org\openjfx\javafx-controls\11.0.2\javafx-controls-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-graphics\11.0.2\javafx-graphics-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-base\11.0.2\javafx-base-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-fxml\11.0.2\javafx-fxml-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-web\11.0.2\javafx-web-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-media\11.0.2\javafx-media-11.0.2.jar -m com.example.hellofx/com.example.hellofx.HelloApplication
Error occurred during initialization of boot layer
java.lang.module.FindException: Module com.example.hellofx not found

这是我为VM选项添加的参数,

--module-path "C:\Users\tommy\Documents\Javafx\openjfx-18.0.1_windows-x64_bin-sdk\javafx-sdk-18.0.1\lib" --add-modules javafx.controls,javafx.fxml

除了测试此数据外,两者都有

--module-path "C:\Users\tommy\Documents\Javafx\lib" --add-modules javafx.controls,javafx.fxml

我尝试使用的必要文件,而是使用Spaces使用了必要 的文件。在双引号中,我尝试重建项目,移动项目文件夹,移动库文件夹。到目前为止什么都没有。

但是,当我不添加VM选项时,似乎运行良好,但是,除了给出的默认测试外,我没有测试编码任何内容。

I am trying to add VM options but when I do I experience this error. I'm currently using Maven with the current version of IntelliJ and JavaFX 18.0.1 on Windows 10 64x

"C:\Program Files\Amazon Corretto\jdk11.0.15_9\bin\java.exe" --module-path C:\Users\tommy\Documents\Javafx\openjfx-18.0.1_windows-x64_bin-sdk\javafx-sdk-18.0.1\lib --add-modules javafx.controls,javafx.fxml "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\lib\idea_rt.jar=54563:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\tommy\.m2\repository\org\openjfx\javafx-controls\11.0.2\javafx-controls-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-graphics\11.0.2\javafx-graphics-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-base\11.0.2\javafx-base-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-fxml\11.0.2\javafx-fxml-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-web\11.0.2\javafx-web-11.0.2.jar;C:\Users\tommy\.m2\repository\org\openjfx\javafx-media\11.0.2\javafx-media-11.0.2.jar -m com.example.hellofx/com.example.hellofx.HelloApplication
Error occurred during initialization of boot layer
java.lang.module.FindException: Module com.example.hellofx not found

Here is the argument I am adding for my VM options

--module-path "C:\Users\tommy\Documents\Javafx\openjfx-18.0.1_windows-x64_bin-sdk\javafx-sdk-18.0.1\lib" --add-modules javafx.controls,javafx.fxml

In addition to testing this one, both have the necessary files

--module-path "C:\Users\tommy\Documents\Javafx\lib" --add-modules javafx.controls,javafx.fxml

I have tried using spaces instead of the double quotes, I have tried rebuilding my project, moving the project folder, moving the library folder. Nothing has worked so far.

When I don't add VM options it seems to run just fine, however, I have not tested coding anything on it other than the default test it gives.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文