JAR file is a Java Archive file. It is used to combine multiple files into a single file for distribution purposes. A JAR file can contain multiple Java class files, resources, metadata, images, and files. It can be used for aggregating different types of files, but developers use it for Java files only. JAR files are based on ZIP file formats but have a .jar extension. Well, the confusion arises on how to run JAR file in Windows 10.

It can be tricky if you have never worked on Java files before. However, with the correct instructions, anyone can execute JAR files in Windows 10. In addition, you can keep Java updated before proceeding with JAR file execution. Sometimes, the Java project needs a recent version of Java to run without errors.

How To Run Jar File In Windows 10

Sometimes, running the executable JAR files can get complicated. However, you can run the java archive files without any issues and errors with the ways mentioned below.

1. Use Command Prompt Terminal

If you are comfortable with the command line utility, you can run the JAR file via Command Prompt. However, before running the JAR file, it is essential to check if you have Java installed on your system. Then, you can follow the steps given below to know how to run JAR file from Command Prompt.

Step 1: Type “cmd” in the Start menu and open “Command Prompt” from the search results.

Open Command Prompt
Open Command Prompt

Step 2: Type the “java -version” command in the terminal window and press the “Enter” key to execute it.

Check the Java version
Check the Java version

You will get the Java details in the output. If Java is not installed on your computer or the required version is unavailable, you can download and install Java manually.

Step 3: Once Java is installed, you can execute the below command to run the JAR file.

java -jar sample.jar
how to run jar file
Run the JAR file

You need to replace sample.jar in command with your executable JAR file. Then, the output of the java executable file will be displayed on the Command Prompt.

You can either go to the required path to execute the JAR file or enter the path in the command. If you wish to enter the path in the command, it will be like – “java -jar C:\Urvi\Downloadsexamplesample.jar.”

The path and the file name will be changed depending on the folder where the file is saved.

2. Use Java Platform SE Binary

If the JAR files are not executed via commands, you can use the Java Platform SE binary to run it. This would be the default app to open the JAR files in most cases, but if it is not, you can check out the instructions below.

Right-click on the JAR file and select Open with ➜ Choose another app from the context menu.

Select Choose another app
Select Choose another app

Now, select “Java(TM) Platform SE binary” from the list of apps and then check the checkbox next to “Always use this app to open .jar files.”

Use Java(TM) Platform SE binary for how to run jar file
Use Java(TM) Platform SE binary

You can click on “OK” to run the JAR file. Whenever you wish to run the JAR files, you can double-click on them, and it will by default open/run using Java Platform SE binary. Double-clicking on the runnable JAR file is an easy way to run it.

How to Open JAR File in Windows 10?

You can use third-party applications if you just wish to open JAR file and not execute it. There are many applications available that can help you open, edit, and change JAR files.

File Viewer Plus

Download File Viewer Plus for how to run jar file
Download File Viewer Plus

File Viewer Plus is a paid software that can help you open the JAR file. It supports 400+ file formats so that you can use it for other document types as well. The software is easy to use and can help you browse, edit, view, and convert your JAR files.

You can use and test File Viewer Plus with its 14 days free trial.

Price – 58.99 USD

Download File Viewer Plus

You can also opt for the other free and open-source software available in the market. First, however, you need to make sure you download the right software and not the virus.

Final Thoughts On How To Run Jar File

Executing the JAR files is a common task for Java developers, but it can be complicated for a normal user. If you have an application or project that comes in a JAR file, you need to know how to run it to use it. With the help of the above guide, you can know how to run JAR file in different ways: Command Prompt terminal and Java Platform SE binary.

If you cannot run the JAR file using any of the ways, it may mean something is wrong with the file. You can open the file using any third-party application and check its content.

However, if you are still not able to run the JAR file, it may be a non-executable JAR file.

FAQs

How do I run a JAR file in Windows 10?

You can run JAR files in Windows 10 using Command Prompt terminal and Java Platform SE binary.

How do I run a JAR file from the command line?

To run a JAR file from the command line, you can use the “java -jar filename.jar” command in the Command Prompt.

Can any computer run a JAR file?

Any PC that has JRE (Java Runtime Environment) installed on it can run the JAR file quickly.