This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

problem in running jar file

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not able to see your figure. Please copy and paste the error message you're receiving exactly as it appears.
 
sagar khana
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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."
 
Sheriff
Posts: 22815
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Run the JAR file from the command line using java -jar, that way you'll get to see the actual exception / error.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the program in the .jar something you coded or someone elses's code?
 
sagar khana
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 22815
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please show us the contents of your MANIFEST.MF file.
 
sagar khana
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 22815
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the Main-Class entry? Without that, a JAR file is not an executable JAR file.
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic