Java FX Modular Application, Module not found (Java 11, Intellij)

风流意气都作罢 提交于 2019-11-27 08:23:43

问题


Hello I have a problem with my modular Java FX Application.

First of all I created a JavaFX Project with the Intellij Wizard.
I added the Java FX lib:

And the JavaFX modules get recognized. My module-info.java:

I also added the VM options:

But I always get this errormessage:

"Error occured during initialization of boot layer
java.lang.module.FindException: Module HelloFX not found"

Thank you.


回答1:


When you get the error:

Error occurred during initialization of boot layer

java.lang.module.FindException: Module HelloFX not found

it means that the path to the module in question in --module-path is wrong and the module can't be found.

Check the output folder. Based on your first picture, the output of the HelloFX project goes to out, but your VM options you are setting the relative path to mods.

You can configure the compiler output from IntelliJ -> File -> Project Structure -> Project -> Project Compile Output.

On Windows by default, when you create a JavaFX project, IntelliJ points to \path-to\HelloFX\out.

Then you either modify that compile output path to \path-to\HelloFX\mods, or your VM arguments:

--module-path "\path-to\javafx-sdk-11.0.1\lib;out\production" 


来源:https://stackoverflow.com/questions/53447738/java-fx-modular-application-module-not-found-java-11-intellij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!