How to run .jar file by double click on Windows 7 64-bit?

coder picture coder · Dec 14, 2011 · Viewed 508.5k times · Source

Running a .jar file in a command line works fine, but i am not able to run any .jar file by double clicking on my Windows 7 (64). It seems nothing happens after the double click.

I tried the ftype hint, no success:

ftype jarfile="C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*

I reinstalled the JDK 7 64-bit, no success.

Any idea?

Answer

AshUK picture AshUK · Jun 1, 2015

If you have previously used the right click and opened with \path\to\your\javaw.exe then you will need to remove the following registry key.

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar]

Then run

C:\>assoc .jar=jarfile
C:\>ftype jarfile="C:\path\to\your\javaw.exe" -jar "%1" %*