I have been trying to create an excutable jar file. When trying to added new data to the manifest file it give me an error say 'invalid header field name: |||Manifest-Version:'. Iam using the command line:

jar -cfm App.jar META-INF\MANIFEST.MF mainui\*.class

the mainfest file looks like this

Manifest-Version: 1.0
Created-By: 1.4.2_13 (Sun Microsystems Inc.)
Main-Class: mainui.MainUI

It encoding is UTF-8. Can anyone see where im going wrong here.



11 Years
Discussion Span
Last Post by Declan123

Since your error message indicates garbage in front of "Manifest-Version", I assume your file contains garbage there.
Try recreating the manifest file from scratch, do as most people do and use ANT to make it for you ;)


Thanks Peter and J, I got it working by not trying to create the manifest file first and using the (M) command, but rather let the jar app create the default one with the cf command, then extract using the xf command, then edit the manifest file and re-create the jar usinf the cfm command, i think maybe the the format UTF-8 that is supplied in notepad is not completely what the jar file is looking for in a manifest file...

Thanks again :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.