How to Open a JAR File on Windows 10

A JAR file is a Java program, so Windows 10 needs Java to run it. Install the free Microsoft Build of OpenJDK and turn on its option to associate .jar files. Then double-click the JAR, or run java -jar with the file name in Command Prompt.

Applies to: Windows 10. Checked against Microsoft Learn on September 28, 2026.

Only open JAR files you trust

A JAR file is an app. Like any app, it can harm your PC if it comes from a bad source. Only run JARs from people or sites you trust.

Install Java

  1. Install the Microsoft Build of OpenJDK. See how to install the JDK on Windows 10.
  2. In the installer, keep the options that add Java to your PATH and associate .jar files turned on.

Run the JAR file

Double-click it. If Java is set up, the program opens. Programs with a window work best this way.

Or use Command Prompt. This works for every JAR and shows any messages:

  1. In File Explorer, open the folder with the JAR file.
  2. Click the address bar, type cmd, and press Enter. Command Prompt opens in that folder.
  3. Type java -jar followed by the file name, and press Enter.
Command Prompt running java -jar with a file name and showing the program's output
Type java -jar and the file name (1), then read the program’s output (2).

Make a shortcut or give the program more memory

  • Shortcut without a black window: right-click the desktop, select New > Shortcut, and enter javaw -jar "C:\path\to\app.jar" with your file’s path. javaw runs the program without opening Command Prompt.
  • More memory: some programs, such as game servers, need more RAM. Use java -Xmx2G -jar app.jar to allow up to 2 GB.
  • A double-click file that shows messages: in Notepad, type java -jar app.jar on one line and pause on the next, then save it as start.bat in the same folder. Double-click it to run the JAR and keep the window open.

If double-clicking doesn’t work

  1. Right-click the JAR file and select Open with > Choose another app.
  2. Select OpenJDK Platform binary, check Always use this app to open .jar files, and select OK.
How do you want to open this file window with OpenJDK Platform binary selected and the Always use this app box checked
Select OpenJDK Platform binary (1), check Always use this app (2), then select OK.

If you can’t see the .jar ending, see how to show file extensions in Windows 10.

See what’s inside a JAR file

A JAR file is a ZIP file inside. Make a copy, change the copy’s ending from .jar to .zip, and open it in File Explorer to see the files.

Common JAR error messages

  • Unable to access jarfile: the name or folder is wrong. Check the spelling, and put the path in quotes if it has spaces.
  • no main manifest attribute: the JAR is a library for other programs, not an app you can run on its own.
  • ‘java’ is not recognized: Java isn’t installed, or it’s not on your PATH. Reinstall it with the PATH option turned on, then open a new Command Prompt.

Frequently asked questions

Is Java the same as JavaScript?

No. JAR files need Java. JavaScript is different and runs in your browser. If a website says JavaScript is turned off, see how to enable JavaScript on Windows 11.

What if it says the JAR needs a newer Java?

Install a newer version, such as OpenJDK 21 or 25, and try again.

Can I turn a JAR into an EXE?

Developers can use the jpackage tool that comes with recent JDKs to build a Windows installer with Java included. As a user, it’s simpler to install Java and run the JAR.

Do I need the full JDK or just a runtime?

The Microsoft Build of OpenJDK includes everything needed to run JAR files, so one install covers both running and building Java programs.

Can I open a JAR file on Windows 11 the same way?

Yes. The steps, including the java -jar command and the Open with setting, work the same way on Windows 11.

Is it safe to run JAR files from games or mods?

Only from the official site or a well-known mod site. Scan the file with Windows Security first by right-clicking it.

If you only need Java to run programs, see how to get Java for Windows 10.

Microsoft’s reference is Install the Microsoft Build of OpenJDK. More help is on our Windows Help & Guides page.

Related: How to open a JNLP file in Windows 11.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy