A Jar file is essentially a Java file that requires the Java runtime to open.
Although many apps use Java, this does not mean that when you run a Java-based app, you will always be running JAR files. It’s possible that you’re still running an EXE file. However, a purely Java-based file can still be found.
You may come across the JAR or JRE file extension when dealing with Java files. Both can be run in the same way, but you’ll need to have the Java runtime installed on your computer. It’s possible that it’s already installed on your system, but you don’t have the correct version to run the Java file.
Check for Java Runtime
You must first check if you have the Java runtime installed on your system before you can open a JRE or JAR file on Windows 10.
- Open Command Prompt.
- Run the following command.
- If the command returns ‘java’ is not recognized as an internal or external command,
operable program or batch file.’, that means you do not have Java installed on your system.
How to Run a Jar file on Windows 10
Now that we’ve established whether or not you have Java installed, we can proceed to opening a JAR file. The first step is to get Java installed.
Install Java runtime
- The official Java website can be found here.
- Click the Agree and Download button after clicking the Download button.
- Java will be installed if you run the EXE file that was downloaded.
- When the installation is complete, you will receive a message stating that the installation was successful.
- Open Command Prompt and type the following command to verify the installation. It will return the Java
- version that is currently installed.
1. How to Open JAR files – Open With
The icon of the JAR file should change to show it is associated with Java after installing the Java runtime. You can open Jar files the file by double-clicking it. Follow the steps below if the file won’t open or the icon hasn’t been updated.
- Right-click the JAR file and select Open With… from the context menu.
- From the menu that opens, select Java(TM) Platform SE binary.
- Check the ‘Always use this app to open .jar files’.
- The icon for the JAR file will be updated and for all JAR files on your system, you can now double-click and open them.
2. How to Open JAR files – Settings app
When using the Open With context menu option, files are not always associated with their default apps. If the first method doesn’t work and you can’t open a JAR file by double-clicking it, try the next one.
- Open the Settings app.
- Go to the Apps group of settings.
- Select the Default Apps tab.
- Scroll to the bottom, and click Choose default apps by file type.
- Scroll down the list of extensions and find .JAR.
- Click the plus button.
- In the window that opens, select Java(TM) Platform SE binary.
- While you’re at it, you might want to do the same for all the other Java file formats listed.
3. Open JAR file – Command Prompt
JAR files can be opened from the Command Prompt.
- Open Command Prompt. You do not need admin rights.
- Find the complete path to the JAR file that you want to open.
- Use the following command to open the file.
java -jar complete path to file
Troubleshoot JAR files
Java has been around for a long time, and it is still being updated. However, it still hasn’t resolved all of the issues it had in its early years, which is why you might have trouble opening a JAR file.
- Check to see if Java is allowed to run on your computer and if Windows Defender hasn’t blocked it. Allow a JAR file on your system if it is flagged and you know it is safe.
- Because version compatibility is sometimes an issue, you should check the Java version. You’ll have to downgrade the JAR file to the correct version if it hasn’t been updated to run on the latest version of Java.
- If a file says it requires Java to open, but it downloads as a ZIP or RAR, you’ll need to extract it first.
Java is no longer as widely used as it once was. When knowledge of the platform was more widespread, opening JAR, JAVA, and JRE files was not as difficult, but it has since become somewhat obscure. Some Java-based apps include files that allow them to run without having to install the official runtime, making it difficult to tell if they are using Java.