How to Run .JAR Files on Windows 10
If you find yourself unable to open .jar files on Windows 10, it is likely due to one of the following problems:
*The Java Run-Time Environment is not properly set to run .jar files
*Windows Registry is not calling JRE (Java Runtime Environment) properly
Luckily there are a couple of easy solutions for fixing this. What happens for most people is that when trying to open a .jar file, Windows will typically ask what program you want to use to run the program. Of course, most people would simply choose the Java.exe, but this has the problem of stripping –jar from the program’s execution path. Basically you cannot set the required complex command to open .jar files by using “Open With…” in Windows 10.
So what will normally happen is that you’ll associate the .jar file to open with java.exe, you double-click on the executable .jar, and a command prompt window will open for a split second and close, and the program does not launch.
What we need to do is re-associate the .jar file with the Java binary.
- Make sure you are updated with the latest Java Runtime Environment.
- Navigate to your Java installation folder, go inside the /bin/ folder, right-click on Java.exe and set it to “Run as Administrator”.
- Press Windows + X keys and select “Command Prompt (Admin)” or Powershell (Admin) and type cmd
- Type the following commands into the prompt (replace the C:\Program Files\etc with your actual Java installation folder, for example, 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 the command prompt to stay open after launching the .jar file (for debugging purposes)
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 of the steps above you took, the java executable should either launch or launch with a persistent command prompt behind it (which will fill up with Java calls from the app, useful for debugging purposes).
However, if the steps did not work, we will need to tweak your registry.
- Right-click on your 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 folders “jar_auto_file” and “jarfileterm”.
- Expand to the following path
jar_auto_file > Shell > Open > Command
- You will see a key named “Default”. Right-click on “Default” and choose “Modify”.
- Now in the “Value data” box, paste the ftype command you entered earlier in the command prompt, so it looks like the screenshot below, and press OK.
- Now do the same thing for the jarfileterm folder (expand jarfileterm > Shell > Open > Comand).
- Now exit regedit and launch your .jar file, it should open properly now!