Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Running JAR file problem

807603Jan 17 2008 — edited Jan 21 2008
Hi guys,

I have built a little gui-app in NetBeans which, when compiled, creates a file LadderTrader.jar in the dist folder in the project folder.

I would like to run this jar file from the linux bash line, but then get this error:
+
ltsmm@gertlx:~/gjava/LadderTrader/dist$ java -jar LadderTrader.jar
Failed to load Main-Class manifest attribute from
LadderTrader.jar
ltsmm@gertlx:~/gjava/LadderTrader/dist$
+

I have tried to modify the manifest file (as pointed out here: http://java.sun.com/docs/books/tutorial/deployment/jar/update.html )
but according to this: http://java.sun.com/docs/books/tutorial/deployment/jar/modman.html the manifest can only be modified when the jar is created I think?

I basically need to add the line: " Main-Class : org.LadderTrader" to the manifest somehow, if anyone can point out how I can achieve this in NetBeans that'd be a great help. I'm using NB 5.5.1 and JDK1.5

many thanks,
Gerry
jar newbie
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 18 2008
Added on Jan 17 2008
10 comments
563 views