2
java -jar PathSim.jar
Error: Could not find or load main class application.PathSim
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

This error pops up when I try to run the jar file from the command prompt.

ChuyMuy
  • 43
  • 4
  • Does this answer your question? [NoClassDefFoundError while trying to run my jar with java.exe -jar...what's wrong?](https://stackoverflow.com/questions/250166/noclassdeffounderror-while-trying-to-run-my-jar-with-java-exe-jar-whats-wron) – Osama A.Rehman Mar 03 '21 at 05:02

2 Answers2

0

Check this out: https://askubuntu.com/questions/1136420/java-lang-noclassdeffounderror-javafx-application-application

If that doesn't fix your issue check to make sure that your main method is written correctly. It should be:

public static void main(String[] args){
//Code
}
0

a execable jar must include main methed. then ,set Main class when packaging jar.

L.Hao
  • 1
  • 2