running a jar file...(help immediately)

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2009
Posts: 108
Reputation: jrosh is an unknown quantity at this point 
Solved Threads: 0
jrosh jrosh is offline Offline
Junior Poster

running a jar file...(help immediately)

 
0
  #1
Sep 11th, 2009
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...
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

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

 
0
  #2
Sep 11th, 2009
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?
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 108
Reputation: jrosh is an unknown quantity at this point 
Solved Threads: 0
jrosh jrosh is offline Offline
Junior Poster

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

 
0
  #3
Sep 11th, 2009
OK ..how can I run it then??

please refer to my other post too....

Thankx in advance.....
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

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

 
1
  #4
Sep 11th, 2009
java -jar <jarfile>

As stated in the tutorial that I linked to in one of your other threads.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 108
Reputation: jrosh is an unknown quantity at this point 
Solved Threads: 0
jrosh jrosh is offline Offline
Junior Poster

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

 
0
  #5
Sep 11th, 2009
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!!!
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

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

 
0
  #6
Sep 11th, 2009
Originally Posted by jrosh View Post
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.

Originally Posted by jrosh View Post
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.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 108
Reputation: jrosh is an unknown quantity at this point 
Solved Threads: 0
jrosh jrosh is offline Offline
Junior Poster

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

 
0
  #7
Sep 11th, 2009
Thank got it done.....
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 334 | Replies: 6
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC