File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 agree. Here's the link:
subject: Add Manifest to Jar
It's not a secret anymore!