0

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.

Zombkiin
  • 23
  • 4
  • 2
    my IDE is Eclipse, so don't know what happens in Intellij - but when I see module not found for _my own module_ there's some weird (read: don't understand why ;) stale state somewhere. For me, it often helps to delete all/some _run configurations_ for that project (don't know if/what is the counterpart in Intellij). – kleopatra Jul 03 '22 at 10:01
  • You don’t need to add VM options or use the sdk. Maven knows where the modules are and so does Idea, from Maven. Idea will put your classes and the maven modules on the module path by default, you don’t need to do anything special. Ensure your IDE is up to date. Follow [these instructions](https://stackoverflow.com/questions/71498158/java-lang-module-findexception-module-test-not-foundintellidea). I advise using jdk 18 with JavaFX 18. – jewelsea Jul 04 '22 at 04:56
  • Please follow the **Modular with Maven** section here https://openjfx.io/openjfx-docs/ – Andrey Jul 04 '22 at 10:41

0 Answers0