Error message in trying to run a fresh project after trying to remove JavaFX from my system
Hello,
This is the error message I am getting in the IDEA console when I try to run a fresh new project with “add test code" checkbox enabled:
"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition\jbr\bin\java.exe" --module-path C:\javafx-sdk-17.0.2\lib --add-modules=javafx.controls,javafx.fxml "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition\lib\idea_rt.jar=50312" -Dfile.encoding=UTF-8 -classpath "C:\Users\jarno\IDEA Projects\Test\out\production\Test" Main
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
I previously installed JavaFX according to this tutorial: https://openjfx.io/openjfx-docs/#introduction
I have since stopped using JavaFX as my framework and moved on to libGDX, as that suits my purposes better as I'm mainly a video game developer, but even after removing the JavaFX folder and he “PATH_TO_FX” enviromental variable, I still get that error message. I'm guessing I have added some kind of module dependencies in the IDEA settings somewhere, but can't for the life of me remember where any more. The error messages are suspiciously similiar to those commands shown in the tutorial. Could you guys help me in completely undoing whatever I did back in the days so that the error goes away?
Please sign in to leave a comment.
Okay I found out what was wrong. It was this part specifically: https://openjfx.io/openjfx-docs/images/ide/intellij/modular/ide/idea03.png
I had to clear out the “VM Options” text field back to its original empty form in the “Application” template, which I'm guessing made it look for the JavaFX module by default in all created projects. Now the example code program runs without a hitch.