File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes problem in running jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "problem in running jar file" Watch "problem in running jar file" New topic
Author

problem in running jar file

sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
howdy
hey i am having problem in running jar file when i double click it says error as shows in fig i have added main class but still its keep coming please show me some guidance

thank you very much for your help
god bless you

Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 563
I'm not able to see your figure. Please copy and paste the error message you're receiving exactly as it appears.


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
Greg Brannon wrote:I'm not able to see your figure. Please copy and paste the error message you're receiving exactly as it appears.


ok sorry

here what it is written:

"A java exception has occured."
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

Run the JAR file from the command line using java -jar, that way you'll get to see the actual exception / error.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

Is the program in the .jar something you coded or someone elses's code?


luck, db
There are no new questions, but there may be new answers.
sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
thank you so much for your reply

Rob Spoor wrote:Run the JAR file from the command line using java -jar, that way you'll get to see the actual exception / error.


ya i tried it says following error:

Exception in thread main java.lang.NullPointerException
at sun.launcher.LauncherHelper.getMainClassFromJar<Unkown Source>
at sun.launcher.LauncherHelper.checkAndLoadMain<Unkown Source>

i have added main class in txt file before making jar file and there were no error in program


when i make jar file using JOptionPane it runs ok but when i use my code it gives error

thank you
sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
thank you for your reply

Darryl Burke wrote:Is the program in the .jar something you coded or someone elses's code?




it is my code and its running perfect in .java file
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

Please show us the contents of your MANIFEST.MF file.
sagar khana
Greenhorn

Joined: Jan 15, 2012
Posts: 21
Thanks for your reply

Rob Spoor wrote:Please show us the contents of your MANIFEST.MF file.


this is the content in Mainfest.mf
Manifest-Version: 1.0
Created-By: 1.7.0_01 (Oracle Corporation)

thank you very much
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

Where is the Main-Class entry? Without that, a JAR file is not an executable JAR file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in running jar file