Type to search

How to run a Jar file on Windows 10 [QUICK GUIDE 2020]

A file with .jar extension is basically a Java Archive file that is used during run-time of Java programs related to any application. Some applications contain files that can perform the execution of .jar files. But some files need to be executed manually.

If you are dealing with such a circumstance then you have to learn how to run a jar file. We have mentioned all the practically possible methods to execute a jar file. Go through this guide to learn more.

Tips on How to Run a JAR File

As we have mentioned above, Java is a must to open a jar file. If you don’t have Java installed on your device then you can go through the methods mentioned below. We have kept the methods as minimal as possible for easy understanding.

Tip 1: Add Java

We have discussed the procedure to install Java on Windows and macOS here.

For Windows

You can’t run jar files on your Windows system without installing Java. Follow the guidelines below to get Java.

  1. Download the latest version of Java from the official website.
  2. Once the download completes, double-click on the package of the jar file. If it opens, then everything is ok. Otherwise, follow the steps further.
  3. You can notice a pop-up window asking for your permission. Choose the Java (™) option. Next, click the OK button.
  4. If it still doesn’t open,  make sure that the file is executable.
  5. Update the version of Windows that you are using.

Now, try opening the jar file on your Windows device.

For Mac

Go through the instructions cited below to install Java on your Mac device.

  1. Download the latest version of Java on your MacBook. When you are going to install a non-Apple file on MacBook, you have to do the following. Navigate the path: Apple Menu> System Preferences> Security and Privacy. You have to unlock the menu. Choose the Open Anyway option next to the file’s name. Opt for the Open option when the prompt appears.
  2. Double-click the jar file to open. It should open now. If it doesn’t work, then follow the instructions further.
  3. A pop-up window should show up on the screen. Select the Java (™) option. Proceed with the OK button.
  4. Make sure whether the jar file is executable or not. 
  5. Update Java to the newest version.

Tip 2: Open with Java(™) Platform SE Binary

If the first method didn’t help you, you can try this hack. Use these simple steps to run a jar file.

  1. Make sure that you have the updated version of Java.
  2. Next, you have to right-click on the jar file. Choose the Open With option from the drop-down menu.
  3. Opt for the Choose Another App option from the list.
  4. You have to locate and choose Java(™) Platform SE Binary option.
  5. Check the box next to the Always Use This App To Open Jar Files option.
  6. Tap the OK button.

Try opening the jar file.

Tip 3: Use Command Prompt

As an alternative, you can use the Command Prompt to run the jar file.

  1. Press and hold Win+X keys from the keyboard.
  2. Choose Command Prompt (Admin) option from the contextual menu.
  3. Enter the following command: java -jar c:jarfilepath.jar. Mention the path of the jar file in the place of jarfilepath. Press Enter.
  4. There is another quick way through the Command Prompt. Just enter ‘cd/’ followed by the path of the directory of the jar file. Finally, hit Enter.

Hope, you find the guide helpful and throws light on how to run a jar file.