I\'ve compiled a java project into a Jar file, and am having issues running it.
When I run:
java -jar myJar.jar
I get the following err
In your manifest file, make sure you have the attribute Main-Class
set to the name of the class containing your main()
method. For example, if the package-qualified name of the class is my.cool.Class
, then, in your JAR manifest, Main-Class
should be set to my.cool.Class
.
Also made sure that you have a package declaration in your .java
files (for example, in Class.java
, make sure you have the proper package my.cool;
declaration). Also, make sure your directory hierarchy is set up correctly (my.cool.Class
should be in $SRC/my/cool/Class.java
).