This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Add Manifest to Jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Add Manifest to Jar" Watch "Add Manifest to Jar" New topic

Add Manifest to Jar

Qusay Jaafar
Ranch Hand

Joined: May 06, 2002
Posts: 127
I tried to add a Manifest.MF file to jar. Manifest.MF contains the following:
Manifest-Version: 1.0
Main-Class: com.gui.MyMainFile
I put Manifest.MF in C:/MyDir/(I put it and creating jar file, here)
to create jar file, I used:
jar -cfm MyJar.jar Manifest.MF -C classes .
what happen, MyJar.jar always uses its default Manifest.MF
Please, what's wrong here???

Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Quasy,
have you checked whether your manifest file conforms to the specification? (Is there a line feed/carriage return in the last line?)
Hope this helps.

Qusay Jaafar
Ranch Hand

Joined: May 06, 2002
Posts: 127
pressing Enter key at the end of the line Main-Class:..... and it will be everything is fine.
thank you for your reply.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Add Manifest to Jar
It's not a secret anymore!