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 ?
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.
Check that your manifest.txt file contains the content in this manner :
Main-Class: <"package-name">.<"Main-class-name">.class <"newline">
Note that newline/carriage-return is necessary for parsing.
Refer to this link http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With