0

Can't convert intellij javafx project into JAR Error: Could not find or load main class sample.Main Caused by: java.lang.ClassNotFoundException: sample.Main

PROJECT STRUCTURE

Run and Debug configuration

Command tried in terminal : java --module-path /home/veera/Documents/Packages/openjfx-15.0.1_linux-x64_bin-sdk/javafx-sdk-15.0.1/lib --add-modules javafx.controls,javafx.fxml,javafx.graphics --add-exports javafx.base/com.sun.javafx.runtime=controlsfx --add-exports=javafx.base/com.sun.javafx.event=controlsfx --add-exports=javafx.controls/com.sun.javafx.scene.control=controlsfx --add-exports=javafx.base/com.sun.javafx.collections=controlsfx --add-exports=javafx.graphics/com.sun.javafx.css=controlsfx --add-exports=javafx.graphics/com.sun.javafx.scene.traversal=controlsfx --add-exports=javafx.graphics/com.sun.javafx.scene=controlsfx --add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=controlsfx --add-exports=javafx.controls/com.sun.javafx.scene.control.inputmap=controlsfx --add-opens=javafx.base/com.sun.javafx.event=controlsfx --add-opens=javafx.controls/javafx.scene.control.skin=controlsfx -jar RegisterLogin.jar

Veera Silamban
  • 223
  • 1
  • 14
  • 1
    At first glane, the project name is `Register&Login` but the name of the jar passed at the command line is `RegisterLogin.jar` (without the `&` character between Register and Login). Maybe have a look at the name of the generated jar again? – Tcheutchoua Steve Feb 11 '21 at 07:41
  • I have changed the name of my project but its still giving the same error – Veera Silamban Feb 12 '21 at 16:39
  • I know it's been a few days, but have you tried creating the `.jar` using [any of these solutions](https://stackoverflow.com/questions/1082580/how-to-build-jars-from-intellij-properly)? (check the comments as well) – Doombringer Feb 20 '21 at 05:39

0 Answers0