Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run JavaFX 11 with Eclipse

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.)

like image 659
Ali Avatar asked Mar 07 '19 06:03

Ali


People also ask

Why is JavaFX not working in Eclipse?

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.

Does Java 11 support JavaFX?

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.


Video Answer


1 Answers

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!

like image 97
Ali Avatar answered Sep 30 '22 17:09

Ali