Skip to main content

Exception while creating a jar file

3 replies [Last post]
ajayyaduwanshi
Offline
Joined: 2007-10-11

Hi All,
I am getting the below exception while I am trying to create a jar file.
Manifest.txt is the name of the manually created manifest file and Main is the package name where my main method class resides.

jar cfm Manifest.txt 800PBXMAIN.jar main/*.class
java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes
at java.util.jar.Manifest.read(Manifest.jav
at java.util.jar.Manifest.(Manifest.j
at sun.tools.jar.Main.run(Main.java:123)
at sun.tools.jar.Main.main(Main.java:903)

Please help me this.
Waiting for a positive response.

Thanks & Regards

Ajay Singh Yaduwanshi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sebastian_puhl
Offline
Joined: 2007-01-22

Hi Ajay,

can you please post your manifest ?

Cheers

Sebastian

ajayyaduwanshi
Offline
Joined: 2007-10-11

Hi,
Thanks for responding to my query, As asked by you about my manifest I am putting here.

Manifest-Version: 1.0
Created-By: 1.5.0_07 (Sun Microsystems Inc.)

Main-Class: MyPackage.MyClass.PBXMain

Hope this will help you.

Thanks & Regards

Ajay Singh Yaduwanshi

sebastian_puhl
Offline
Joined: 2007-01-22

1. Are you sure that you saved the file in the right encoding ? it must be UTF8 . Also try to save the file in plain ASCII so that no formating from applications e.g Wordpad are in it.

2. Second are you aware that there must be a new line at the end of the manifest? If not the manifest will not be parsed properly

Message was edited by: sebastian_puhl