Javafx Exception in Thread "Main" Java.Lang.Noclassdeffounderror: Javafx/Application/Application

I'm encounter a java.lang.NoClassDefFoundError and I don't know why it's occuring

Try adding arguments:

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

In eclipse I think you need to navigate to Menu: Window > Preferences > Java > Compiler

How to Fix NoClassDefFoundError in JavaFX?

I think JavaFX is not a part of the JDK > 9 any more. (Your version is 12.x.x)

Probably this could help you:
https://openjfx.io/openjfx-docs/#install-javafx

(Assuming you are using Maven) If this does not help, try to clean and build your Application.
Sometimes Maven does not recognize newly added dependencies.



Related Topics



Leave a reply



Submit