I am trying to run a simple program using JavaFX 11 with Eclipse, but I am getting this error:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module format not recognized: D:\javafx-sdk-11.0.2\lib\src.zip
I followed these instructions. This is where JDK & JavaFX are located:
D:\javafx-sdk-11.0.2\
C:\Program Files\Java\jdk-11.0.2
The VM arguments are:
--module-path "D:\javafx-sdk-11.0.2\lib" --add-modules=javafx.controls,javafx.fxml
Please help to identify and rectify the problem. (I tried several things as suggested below, but nothing seems to be working.)
The project doesn't support the JavaFX syntax. We need to export the JavaFX jar files to the project in order to run the JavaFX application. Just Right click on the project and select properties from the options. Go to Java Build Path → Libraries.
In Java 11, JavaFX was removed from the SDK. It is now in its own separate module, and if you want to use it in your application you will need to specifically include it.
While making user library for JavaFX 11, I was adding all the files including .jar
and the src.zip
file.
However, now that I didn't select the src.zip
file, it's working fine. :-)
This is the VM argument:
--module-path "F:\javafx-sdk-11.0.2\lib" --add-modules=javafx.controls,javafx.graphics,javafx.fxml
(Yup, on this PC, I used the F: drive.)
Thanks all for your support!
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