Unable to run .jar files by double-clicking them on Windows 7

I had the issue as well. The solution is even more simple. Add the missing -jar argument.

Go to HKEY_CLASSES_ROOT\jar_auto_file\shell\open\command and set the default value to:

"C:\Program Files\Java\[...]\java.exe" "-jar" "%1" 

All was missing was "-jar" option.

Enjoy!


I ran into someone who had the same problem you did today. And somehow, I managed to fix it, although I am not sure entirely what fixed it; I can only offer you the approximate series of steps I've taken.

Using regedit, I found that HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE registry entries weren't in agreement. HKLM had the typical .jar->jarfile setup, with jarfile pointing to the right path. HKCU had a .jar -> jar_auto_file association which pointed to an old an invalid path.

Editing this path did not fix it. I also tried pointing it to jarfile, which didn't help either. I fussed with assoc and ftype a bit to see if this might wake Windows up; I figured the anti-hijacking functionality somehow prevented Windows from listening to the updated path. Sadly, it didn't do much.

So eventually I just deleted the jar_auto_file entry. This gave me partial happiness: Windows finally realized the entry in the Open With menu was the one with a working path. (Selecting the correct path/file in the past would never stick around correctly.) Sadly doubleclicking was still broken. However, just making sure the 'Always open this type of file with this program' box was checked and opening it finally fixed the association well enough that doubleclicking actually worked again.