java -jar file.jar
works fine, but if I double click on it nothing happens.
I've tried everything I could find but nothing seems to fix this. I've checked regedit, file associations, uninstalled oracle java and tried open jdk, tried different version of java, etc. The problem remains.
Regedit has HKEY_CLASSES_ROOT\jarfile\shell\open\command
correctly set. File associations on windows are also correctly set. When I double click on the jar file, java runs (a cmd window quickly appears and then disappears) but nothing happens.
> java --version
java 15.0.1 2020-10-20
Java(TM) SE Runtime Environment (build 15.0.1+9-18)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)
> assoc .jar
.jar=jarfile
> ftype jarfile
jarfile="C:\Program Files\Java\jdk-15.0.1\bin\java.exe" -jar "%1" %*
How can I fix this so that I can open the file by double clicking on it?
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar
and look there. :) I myself would delete this key. That should force the associations back to the HKCR key you mention.. back it up if you want.. or you can figure out the new registry keys in the location I mention.Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileAssociation
and see if there is a clue there as to what is happening. If that doesn't help, there is always the tried and true process monitor and snooping what keys the explorer is looking at.HKEY_CLASSES_ROOT\jarfile\shell\open\command
doesn't mean anything ifComputer\HKEY_CLASSES_ROOT\.jar
isn't pointing tojarfile