Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add Manifest to Jar

 
Qusay Jaafar
Ranch Hand
Posts: 127
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic