Hi when in try to run jar file this error shown : "failed to load main-class manifest attribute from ..." but when i run project in netbeans it`s run successfuly !!!
+7
A:
If you want to run a JAR file directly (java -jar program.jar
), you must set the Main-Class
attribute in the manifest file. See http://java.sun.com/docs/books/tutorial/deployment/jar/appman.html for details.
Otherwise, you need to set the JAR on the classpath instead and tell it the class to run. (java -cp program.jar class.with.main.method
)
jdmichal
2010-06-28 21:29:28
How to use ANT to build an executable .jar file for you: http://www.vertigrated.com/blog/2009/11/how-to-bundle-command-line-programs-into-a-single-executable-jar-file/
fuzzy lollipop
2010-06-28 21:38:16
http://www.petefreitag.com/item/24.cfm
nevets1219
2010-06-28 21:43:00