I’m making a project where I need to connect a Pinpad in my USB port. An organization gave me a .jar demo to see how my application needs to operate. Some weeks ago I opened this demo and everything was fine I just wrote and opened it. Then I found an error in my application and thought it had to be something involved with Java version so I uninstalled and installed from java jdk 8 to jdk 14. The error involved other stuff so I stayed with jdk-11.0.7 and javafx-sdk-11.0.2.
When I tried to open de demo again this error appeared.
Error: Could not find or load main class “ClassName”
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
The solution was to add modules in cmd
java --module-path C:\Users\Name\Documents\InstaladoresProgramas\JAVFX\javafx-sdk-11.0.2\lib --add-modules=javafx.controls,javafx.fxml,javafx.base,javafx.media,javafx.web,javafx.swing -jar demo.jar
Now the application crashes with this error