I created a jar file using cmd prompt.

when i run it using : jar cvfm <filename>.jar manifest.txt *.class

gives the error:

java.io.IOException : invalid header field....

Please help me to solve this...

Recommended Answers

All 6 Replies

That is how you create a jarfile, not how you "run it". Now, in which step are you having problems. When creating it, or when executing it?

OK ..how can I run it then??

please refer to my other post too....

Thankx in advance.....

java -jar <jarfile>

As stated in the tutorial that I linked to in one of your other threads.

commented: Good point! +5

clicking jar file says :
Could not find the main class (note : I created the manifest file)

clicking bat file says:
unsupportedClassVersionError: bad version number in .class file

:( Sory to bothr so much!!!

clicking jar file says :
Could not find the main class (note : I created the manifest file)

Then you either did not configure the manifest file properly, or you did not include the main class in your jarfile.

clicking bat file says:
unsupportedClassVersionError: bad version number in .class file

:( Sory to bothr so much!!!

Then, as stated before, you are not using the correct version of java for either your compiling and/or executing.

Thank got it done.....:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.