This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes problem with running jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "problem with running jar file" Watch "problem with running jar file" New topic
Author

problem with running jar file

oriakhi joseph
Greenhorn

Joined: Oct 06, 2011
Posts: 12
i converted my class file to .jar file but when i double click on the file its does not run, gives an error: a java exception has occured, when trying to open it with the jvm
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

How did you convert your class in .jar file? Does your class contain a main method and did you include a MANIFEST.MF file in the jar to tell the JVM which class to invoke when the jar file is run?


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
oriakhi joseph
Greenhorn

Joined: Oct 06, 2011
Posts: 12
yes my class contains a main method, and i used this command : jar cvf Sample.jar*.class , please help me out , i dont know of the manifest file
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 679

You can look inside of you .jar file by changing the extension from .jar to .zip and then unzipping the file and looking into it.
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

oriakhi you can read about manifest files here. You'll specifically need to do this...
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: problem with running jar file
 
Similar Threads
Class Loader
Problem in creating executable jar (Eclipse)
JBoss3.0 can't support EJB2.0?
creating java file
Directory, File, Jar input problem