I\'m getting this error
Exception in thread \"main\" java.lang.NoClassDefFoundError: javafx/application/Ap
plication
at java.lang.ClassLoader.defineC
I had the same problem and below steps helped me to solve it,
Adding the vm arguments while running the application,
--module-path /home/user/Java-libraries/openjfx-11.0.2_linux-x64_bin-sdk/javafx-sdk-11.0.2/lib/ --add-modules javafx.controls,javafx.fxml
Note:
- The --module-path will contain the jars of Java fx
- I used open-jdk 13
Configure this in your eclipse (If you are using so) or you can just compile and run like,
Compile
javac --module-path /path/to/java-fx-libs/ --add-modules javafx.controls,javafx.fxml *.java
Run
java --module-path /path/to/java-fx-libs/ --add-modules javafx.controls,javafx.fxml MyMainClass