0

I have created an executable jar file and have tried both the extract and package option for generated .jar. It creates it but when clicking on it nothing happens. I tried naming it the same as the class file or the project file too. This didn't happen before I don't know why it stoped working. It won't run even a simple hello world file. However a .jar file I made a while ago will run. I compiled with Eclipse, and running it with java -jar in cmd does work. I am running Windows 07. Any help would be greatly appreciated

Edit: tried uninstalling and reinstalling Java and Java JDK

SolidCloudinc
  • 329
  • 10
  • 27

1 Answers1

1

you should check the application used to open the jar file. it should be java or javaw and should be called with -jar parameter. What Operating system are you using?

Claudiu
  • 1,469
  • 13
  • 21
  • something like [this](http://stackoverflow.com/questions/394616/running-jar-file-in-windows) should help you. you can find there a link to [jarfix](http://johann.loefflmann.net/en/software/jarfix/index.html) – Claudiu Sep 05 '13 at 21:29
  • 1
    is your application a console application, or does it have a graphical interface? If it is a console application, then that is the problem. The jar files are run by default with `javaw` which does not open the console – Claudiu Sep 05 '13 at 21:44
  • It is console. So I have to make a GUI? – SolidCloudinc Sep 05 '13 at 21:48
  • yes, or change how jar files are opened by default. (open them with java instead of javaw) – Claudiu Sep 05 '13 at 22:02