How to Run JAR Files on Windows 11 or 10

Windows 11 is capable of running a plethora of file types, with and without external, third-party applications. Not only does it allow you to carry out a bunch of tasks from the comfort of your PC, but it also makes sure you can utilize the raw power of your PC.

Today, we’ll take a look at one complicated file type — jar —  and tell you how to open it on your Windows 11 or Windows 10 PC.

What is a jar file?

jar is an archive package format that may or may not contain an executable Java program. These archives can either contain java applications or source codes that can then be used to compile and run applications without having to write individual code for each application. You can run .jar files on Windows 11 in various ways and we have listed the most common ones below. Follow the relevant sections to help you along with the process. 

Related: How to check RAM Type in Windows 11: DDR3, DDR4, or DDR5?

How to check if you have Java installed

Before we go further, you’ll need to check whether you have Java installed on your Windows 11 PC. If you don’t use the Java programming language or anything resembling it, chances are, your Windows 11 PC still hasn’t been blessed with Java.

To check if you have Java installed or not, run the simple command given below. Here’s how.

Open Command Prompt. Press the Windows key on your keyboard and type cmd. Then click Command Prompt.

In the command window, type this command:

java -version

Your screen will look like this:

Now, hit Enter to run it. 

Now, if you don’t have Java on your machine, you’ll get an error saying that the command isn’t recognized.

Related: How to Change Mouse Polling Rate on Windows 11

How to install Java (if you don’t have it)

If you do not have Java on your PC and wish to download it to run Java applications, you’ll need to install the Java Runtime Environment or JRE.

To download the latest version of JRE, go to the Java download website.

Now, download the executable file for Windows.

After downloading and installing, go to Command Prompt and type “java -version” again as given above.

Now you should see the version of Java installed on your system.

Related: How to Delete iTunes Backup on Windows 11

4 Ways to run jar files on Windows

Running jar files can either be exceptionally simple or frustratingly difficult. We’ll, of course, start with the basics.

Method #01: Double-click to run

After installing JRE or JDK, you’ll have the means to run a jar file natively on your PC. You should see your jar files in Java executable form right off the bat. If you don’t, you’ll need to right-click on the jar file and choose to run it using the OpenJDK platform library or similar.

With any luck, a simple double-click would run the jar file like a charm.

Related: How to Increase Download Speed Windows 11

Method #02: Create a .bat file to run unsigned or custom .jar archives

If you’ve compiled a .jar archive on your own and would like to run the same on other PCs then a .bat file can help you with the same. To do so, first, open up any Windows Explorer window, click on the 3-dot menu icon and select ‘Options’. 

Now, go to the ‘View’ tab and uncheck the option ‘Hide extensions for known file types.’

This will reveal the full name — with extension — of your files.

Now, open up a Notepad file inside the folder where the concerned jar file is located. Now, add this line to the text file.

java -jar yourfilename.jar

Now, save the file with the “.bat” extension. You can hit Ctrl + Shift + S on your keyboard to do the same. 

That’s it. Now, every time you double-click on the batch file, it’ll be redirected to the jar, and the executable file should run as planned.

Related: How to Turn Down Bass on Windows 11

Method #03: Fix jar file association

After creating an executable batch file and linking with the Jar, you should be able to run the program without a hitch. However, if for some reason, you’re not getting the desired result, we’d encourage you to get the Java file association checked.

Packing/unpacking applications, such as WinZip, WinRAR, and more can damage the file association with JavaAW — the program that ultimately executes your jar files. Follow the guide below to help fix .jar file associations on your PC.

3.1) Using Settings

Press Windows + i on your keyboard to open the Settings app. Now click on ‘Apps’ on your left.

Now click on ‘Default apps’.

Scroll to the bottom and click on ‘Change defaults by file type’. 

Click on the search box at the top. 

Now type in ‘jar’ and hit Enter on your keyboard. 

Click on the .jar listing from your search results. 

Click on ‘More apps’ and select Java that we installed earlier.

Click on ‘OK’ once you are done. 

File type associations will now be changed for the .jar extension. You should now be able to run .jar files on your PC with a simple double click.

Related: How to Transfer Music From iPhone to iTunes Windows

3.2) Using .jar file properties

Select the .jar file you are trying to open and hit Alt + Enter on your keyboard. 

Click on ‘Change’ beside ‘Opens with:’. 

Click on ‘More apps’ and click on ‘Java’.

Click on ‘OK’ once you are done.

Click on ‘OK’ again in the properties window to apply and save your changes. 

And that’s it! The file type .jar will now be associated with Java and you should be able to open the same on your device with a simple double click. 

Method #04: Run .jar files using CMD

You can easily run .jar files from CMD as well. Follow either of the methods below to help you along with the process. 

Open the folder where your .jar file is located and click on the address bar at the top. 

Type in ‘CMD’ and hit Enter on your keyboard. 

A command prompt will now launch in the same location. Enter the following command and replace ‘NAME’ with the exact name of your .jar file in the same directory. 

java -jar NAME.jar

And that’s it! You will now have executed the desired .jar file from Command Prompt. 

Related: How to Turn Off Screen Saver on Windows 11

FAQs

.Jar file archives can sometimes be misconstrued for executables and vice versa. The way to open and run both of these on Windows requires different approaches, and hence here are some commonly asked questions that should help you get up to speed. 

Can I run .jar games using these methods?

No, unfortunately, you will need a third-party .jar game loader that helps you launch and configure your games accordingly. Games also need to save your progress which is also handled by such third-party apps. 

Why am I unable to extract a .jar archive?

We recommend you verify the .jar file and ensure that it is an archive. In most cases, unsupported content is the reason you are unable to extract .jar files on your system. Additionally, the developer also needs to define the file as an archive for it to be recognized as the same on your device. 

What is the best way to run a .jar file?

We recommend you stick to the double click method. If your file type associations are messed up, you can use the guide above to fix the same on your device. If however, in the rare case that the double click methods do not work for you, we recommend you try the command line method instead. 

Related: Microsoft Edge Location – Where Is It Located on Your System

We hope this post helped you easily run .jar files on your system. If you face any issues or have any more questions for us, feel free to reach out using the comments section below. 


RELATED:

Posted by
Sushan

A mediocre engineer hoping to do something extraordinary with his pen (well, keyboard). Loves Pink Floyd, lives football, and is always up for a cup of Americano.

2 Comments

  1. Works like charm. Thank u for the guide.

  2. Is it not the same set of instructions on how to handle JAR file in Windows 10 and Windows 11? Are they separate?

Comments are closed.