问题
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
回答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?
来源:https://stackoverflow.com/questions/18645674/jar-file-will-not-open