I have a problem with my modular JavaFX application. I created a JavaFX project and added the JavaFX lib and JavaFX modules get recognized. However, I keep getting these error message:
Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.controls not found
Image for the complete setup is attached hereby:
edit:
this is all the errors messages:
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -Djava.library.path=
/home/thenekolite/Documents/JavaTools/javafx-sdk-11.0.1/lib --module-
-path=~/Documents/JavaTools/javafx-sdk-11.0.1/lib
--add-modules=javafx.controls,javafx.fxml
--add-modules javafx.base,javafx.graphics --add-reads
-javaagent:/home/thenekolite/idea-IU-183.4588.61/
lib/idea_rt.jar=35937:/home/thenekolite/idea-IU-183.4588.61/bin
-Dfile.encoding=UTF-8 -classpath /home/thenekolite/IdeaProjects/
Latihan1/out/production/Latihan1:/home thenekolite/Documents/JavaTools/
javafx-sdk-11.0.1/lib/src.zip:/home/thenekolite/Documents/JavaTools/
javafx-sdk-11.0.1/lib/javafx-swt.jar:/homehome/thenekolite/Documents
/JavaTools/javafx-sdk-11.0.1/lib/javafx.fxml.jar:/home/thenekolite/
Documents/JavaTools/javafx-sdk-11.0.1/libjavafx.media.jar:
/home/thenekolite/Documents/JavaTools/javafx-sdk-11.0.1/lib/
/javafx.swing.jar:/home/thenekolite/Documents/JavaTools/javafx
sdk-11.0.1/lib/javafx.controls.jar:/home/thenekolite/
Documents/JavaTools/javafx-sdk-11.0.1/lib/javafx.graphics.jar
-p /home/thenekolite/Documents/JavaTools/javafx-sdk-11.0.1/lib/
/javafx.base.jar:/home/thenekolite/Documents/
JavaTools/javafx-sdk-11.0.1/lib/javafx.graphics.jar sample.Main
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
I also add the vm options:
but still, i got this error messages.
Make sure the JavaFX plugin is enabled To be able to work with JavaFX in IntelliJ IDEA, the JavaFX bundled plugin must be enabled: In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Plugins. Switch to the Installed tab and make sure that the JavaFX plugin is enabled.
To Solve error: module not found: javafx. controls Error You just need to add PATH_TO_FX. First of all Use %PATH_TO_FX% instead of $PATH_TO_FX in the command line. Then Recreate the variables for both system and user PATH_TO_FX enclosing its value in quotation marks.
Since you're running as a Non-Modular application from IntelliJ, you would need to ensure adding the VM argument as :
--module-path /path/to/javafx-sdk-11.0.1/lib --add-modules=javafx.controls,javafx.fxml
You can follow the documentation link as JavaFX and IntelliJ and then Non-modular from IDE for complete setup details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With