what is java.io.IOException: invalid header field?

Suhail Gupta picture Suhail Gupta · Feb 14, 2012 · Viewed 19.6k times · Source

When i try to run the following command :

jar cvfm myjar.jar manifest.txt *.class

I get the following exceptions :

java.io.IOException: invalid header field
    at java.util.jar.Attributes.read(Attributes.java:410)
    at java.util.jar.Manifest.read(Manifest.java:199)
    at java.util.jar.Manifest.<init>(Manifest.java:69)
    at sun.tools.jar.Main.run(Main.java:171)
    at sun.tools.jar.Main.main(Main.java:1176)

What could be the reason i am getting these exceptions ?

Answer

duffymo picture duffymo · Feb 14, 2012

I'm guessing that there's a problem with your manifest file. Give it a look to see if you've got a typo in the name of a header variable.