943,515 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 777
  • Java RSS
Sep 11th, 2009
0

running a jar file...(help immediately)

Expand Post »
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...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
jrosh is offline Offline
140 posts
since Sep 2009
Sep 11th, 2009
0

Re: running a jar file...(help immediately)

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?
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Sep 11th, 2009
0

Re: running a jar file...(help immediately)

OK ..how can I run it then??

please refer to my other post too....

Thankx in advance.....
Reputation Points: 10
Solved Threads: 0
Junior Poster
jrosh is offline Offline
140 posts
since Sep 2009
Sep 11th, 2009
1

Re: running a jar file...(help immediately)

java -jar <jarfile>

As stated in the tutorial that I linked to in one of your other threads.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Sep 11th, 2009
0

Re: running a jar file...(help immediately)

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!!!
Reputation Points: 10
Solved Threads: 0
Junior Poster
jrosh is offline Offline
140 posts
since Sep 2009
Sep 11th, 2009
0

Re: running a jar file...(help immediately)

Click to Expand / Collapse  Quote originally posted by jrosh ...
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.

Click to Expand / Collapse  Quote originally posted by jrosh ...
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.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Sep 11th, 2009
0

Re: running a jar file...(help immediately)

Thank got it done.....
Reputation Points: 10
Solved Threads: 0
Junior Poster
jrosh is offline Offline
140 posts
since Sep 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: (Regard to)running a jar file...(help immediately)
Next Thread in Java Forum Timeline: bluetooth +Serial ports+Symbian





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC