aspose file tools*
The moose likes Beginning Java and the fly likes can't add Main-Class to jar file manifest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can Watch "can New topic
Author

can't add Main-Class to jar file manifest

Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
I created a jar file as follows:
jar cvf food.jar food

"food" is a directory containing "Fruit.java" and "Fruit.class"
Fruit.java just has an empty main method

I created a file "otherManifest.mf":
Main-Class: food/Fruit

I then updated the manifest:
jar uvmf otherManifest.mf food.jar

Java responded: updated manifest

But when I extracted the manifest, it did not have the Main-Class entry.

Where did I go wrong?

Thanks

Mike
[ August 22, 2004: Message edited by: Mike Gershman ]

Mike Gershman
SCJP 1.4, SCWCD in process
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Do you have the required blank line at the end of your manifest?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

needn't you use a dot: ?


http://home.arcor.de/hirnstrom/bewerbung
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
Thanks a lot to both of you.

The blank line was necessary for the jar command to process "otherManifest.mf".

The dot was necessary for the Main-Class value to actually work correctly.
 
wood burning stoves
 
subject: can't add Main-Class to jar file manifest