I want to create a jar file with a main-class.
(all files are in the same directory no packages, I use Java SDK 1.3)
I've made a textfile called manif.mft with only one line (to update the
Manifest.MF):
Main-Class: gui
I tried to create the jarfile with the command:
jar cfm manif.mft testa.jar gui.class kor.class LonePost.class
LoneBiPost.class LoneBiPostSum.class Postgam.class SkapaLon.class
SkapaLonebi2.class SkapaLonebibokning.class SkapaSlutPost.class
Textgam.class TotTxt.class TotTxt2.class
I got the following error message:
java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes.java:354)
at java.util.jar.Manifest.read(Manifest.java:161)
at java.util.jar.Manifest.<init>(Manifest.java:56)
at sun.tools.jar.Main.run(Main.java:125)
at sun.tools.jar.Main.main(Main.java:904)
I also tried to put the line: Manifest-Version: 1.0, in the manif.mft file
but the same error occured.
I have no problem to create a jar without using the manif.mtf file.
Can someone please help me with what information I need to include in the
manif.mtf file for this to work?
Thanks,
Marie
You have the files reversed. The "fm" means the jar file name comes
first, then the manifest file name.
"Marie Henricsson" <Blood...@everyday.com> wrote in message
news:kjcC6.2741$Qp1....@nntp1.chello.se...
Now I got rid of the error message, I created the jar first and updated it
with manif.mft. But the the MANIFEST.MF looks the same as before. No
Main-Class line included.
Thanks,
Marie
"Marie Henricsson" <Blood...@everyday.com> wrote in message
news:kjcC6.2741$Qp1....@nntp1.chello.se...
Now it works.
Thank you.
/Marie
"Marie Henricsson" <Blood...@everyday.com> wrote in message
news:7%cC6.2750$Qp1....@nntp1.chello.se...