A .jar (Java Archive) file is a packaged Java program, and Windows 10 and Windows 11 can’t run it until Java is installed. Install a current Java runtime or JDK (for example Java 21 or 25 LTS), then open Command Prompt, go to the folder with the file, and run java -jar filename.jar. Or right-click the JAR and choose Open with > Java(TM) Platform SE binary (or your Java version). Errors like "no main manifest attribute" have their own fixes below.

Step 1: Check Whether Java Is Installed
- Press Windows + R, type cmd and press Enter.
- Type java -version and press Enter.
- If you see a version number, Java is installed. If you see “‘java’ is not recognized,” install it in Step 2.
Some programs require a specific Java version. Check the program’s website or readme.
Step 2: Install Java
- Download a Java build for Windows x64 (or Arm64 on Arm PCs). Popular free options include Eclipse Temurin from Adoptium, the Microsoft Build of OpenJDK, and Oracle JDK (check Oracle’s license terms for your use).
- Choose the .msi installer and a long-term support (LTS) version such as 21 or 25, unless your program needs another version.
- Run the installer. If offered, enable Set JAVA_HOME, Add to PATH and JAR file association.
- Open a new Command Prompt and run java -version to confirm.
You can also install Java from the command line: winget install EclipseAdoptium.Temurin.21.JDK.
Step 3a: Run the JAR by Double-Clicking
- Open the folder with the JAR file in File Explorer.
- Double-click the file. If it opens in a ZIP tool or asks which app to use, right-click it > Open with > Choose another app.
- Pick Java(TM) Platform SE binary or OpenJDK Platform binary. If it’s not listed, click More apps > Look for another app on this PC and browse to javaw.exe in the Java install’s bin folder (for example C:\Program Files\Eclipse Adoptium\jdk-21…\bin).
- Check Always use this app and click OK.
Double-clicking uses javaw.exe, which doesn’t show a console window. Command-line tools that print text should be run from Command Prompt instead.
Step 3b: Run the JAR From Command Prompt
- Open Command Prompt.
- Go to the folder: cd %USERPROFILE%\Downloads (or wherever the file is). Type cd and drag the folder into the window.
- Run java -jar filename.jar. Put the name in quotes if it contains spaces.
- Add options if needed, such as more memory: java -Xmx2G -jar filename.jar.
In File Explorer, you can type cmd in the address bar and press Enter to open Command Prompt in the current folder.
Create a Shortcut or Batch File
Create a text file named run.bat in the same folder containing:
@echo off
java -jar "filename.jar"
pause
Double-click run.bat to launch the program and keep the window open to see any messages.
Fixing JAR Errors and Warnings
- “no main manifest attribute”: the JAR is a library, not a runnable program, or needs a specific main class. Check the program’s instructions; some use java -cp filename.jar com.example.Main.
- “UnsupportedClassVersionError”: the program needs a newer Java version. Install it and try again.
- Nothing happens on double-click: run it from Command Prompt to see the error message.
- Opens in a ZIP program: fix the association as in Step 3a. Free tools such as Jarfix can also repair .jar associations.
- Windows SmartScreen or antivirus warning: only run JAR files from trusted sources. A JAR can do anything a regular program can.
- Multiple Java versions: run the one you need by its full path, for example “C:\Program Files\Java\jdk-25\bin\java.exe” -jar filename.jar.
A .jnlp file is different from a JAR; here is how to open a JNLP file in Windows 11.
More Questions About JAR Files
Do I need the JDK or just a JRE?
To run programs, a runtime is enough, but many modern Java distributions only offer the full JDK, which works fine.
Can I open a JAR to see what’s inside?
Yes. A JAR is a ZIP file. Open it with 7-Zip or rename a copy to .zip to browse its contents.
How do I run Minecraft server JARs?
The same way: java -Xmx4G -jar server.jar nogui, using the Java version the server requires.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.