Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Why my .jar file wont run ?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello I made a small program in netbeans and it wont run. I have installed JRE. It doesnt say anything it just doesnt start if I double click it. I tried in cmd to start it. HAve you got any ideas ?
 
Bartender
Posts: 2235
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when you run it from the console?
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try running it from the command line.
Open terminal window
Navigate to jar file location
Type java -jar {jar_file_name}.jar
Hit return

The console window will tell you what went wrong. You can copy paste the output here (please UseCodeTags) so we can take a look
 
Serban Cameron
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesnt say anything

Ill post it here:

C:\Users\serban\Documents\NetBeansProjects\Frame\dist>java -jar Frame.jar   (i hit enter)
C:\Users\serban\Documents\NetBeansProjects\Frame\dist>                          

It doesnt give me any error nothing
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your code look like, especially the main() method?
 
Serban Cameron
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It`s a JFrame that i did in Swing. Here is the code:

 
Serban Cameron
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded a jar from git hub and it works so the problem is on my side. None of my apps made in Swing work. Why ?
 
Maneesh Godbole
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your jar self executable?
Does the manifest file contain such an entry?

More info about it here http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic