Reputation: 5818
I have the next problem - my .jar file works when I invoke it from the command line as java -jar name.jar But it does not start when I double click on it on the desktop of my Windows 7... Moreover, when I try to start it with clicking the right buttonof the mouse "open with" and choose Java(TM) SE platform binary it does not start either How to make it start with the double click?
Upvotes: 0
Views: 265
Reputation:
Apparently the .jar
extension is not associated with javaw.exe
on your computer.
To do this, run the following two commands in a commandline window:
ftype jarfile="C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*
assoc .jar jarfile
(Adjust the path to javaw.exe to your installation path)
You should run this with an account that has administrative privileges as this will update the globel registry.
Edit (after the comments):
As Java7 is not yet that widespread, you should re-compile your sources using the compiler switch -target 1.6
or compile them using Java6 right from the start. The your jar file should also with Java6
Upvotes: 2