954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

running a jar file...(help immediately)

I created a jar file using cmd prompt.

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

gives the error:

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

Please help me to solve this...

jrosh
Junior Poster
155 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

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?

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

OK ..how can I run it then??

please refer to my other post too....

Thankx in advance.....

jrosh
Junior Poster
155 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

java -jar

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

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

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!!!

jrosh
Junior Poster
155 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 
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.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

Thank got it done.....:)

jrosh
Junior Poster
155 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You