If you find yourself unable to open .jar files on Windows 10, it could be due to one of the following problems:
- Java Runtime Environment the runtime is not correctly set up to run .jar files.
- The Windows Registry does not call the JRE (Java Runtime Environment) properly.
There are a few easy solutions to fix this. What happens to most people is that when trying to open a .jar file, Windows will usually ask the program you want to use to run the program. Of course, most people choose Java.exe, but this has a ripping -jar from the program’s execution path. You cannot set up the complicated command required to open the .jar file using “Open With…” in Windows 10.
Relink the .jar file with the Java binaries.
Simple steps:
- Make sure you are up to date with the latest Java runtime.
- Navigate to your Java installation directory, go inside C: Program Files JAVA … .. right click on Java.exe and set it as “Run as Administrator”.
- Press Windows key + X and select ” Command Prompt (Admin) ” or Powershell (Admin) and type cmd
- Please type the following commands into the prompt ( replace C: Program Files etc. with your entire Java installation directory, for example, I’m C: Program Files (x86) Java jre1.8.0_131 bin java .exe):
ftype jarfileterm = cmd / s / k “” C: Program Files Java jre7 bin java.exe “-jar”% 1 ″% * “
assoc .jar = jarfileterm
Or if you want command prompt to stay after opening .jar file (for debugging purpose)
ftype jarfileterm = cmd / s / k “” C: Program Files Java jre7 bin java.exe “-jar”% 1 ″% * “
assoc .jar = jarfileterm
Now try to launch the .jar file. Depending on which step you have taken, the java executable has to launch or launch with a continuous command prompt behind it (which will fill Java calls from the application, useful for debugging purposes).
Tweak Registry to run .JAR files on Windows
- Right-click on the Start button and do a search for ” regedit “, then open it.
- Now expand the HKEY_CLASSES_ROOT folder, and scroll down until you find the ” jar_auto_file ” and ” jarfileterm ” folders.
- Expand jar_auto_file > Shell > Open > Command .
- You will see a key named ” Default “. Right-click on ” Default ” and choose ” Modify “.
- In the ” Value data ” box, paste the type command you entered earlier in the command prompt, so it looks like the below screenshot and hit OK.
- Now do the same for the jarfileterm folder (expand jarfileterm > Shell > Open > Comand ).
- Now exit regedit and launch your .jar file. It should open correctly now!