File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add Manifest to Jar

 
Qusay Jaafar
Ranch Hand
Posts: 127
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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)
/classes
/com
/gui/MyMainFile
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???
Regards
 
Mag Hoehme
Ranch Hand
Posts: 194
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 127
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
pressing Enter key at the end of the line Main-Class:..... and it will be everything is fine.
thank you for your reply.
Regards
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic