file.wiki

File extensions

How to open a .jar file

Java archive · Executable / archive

A .jar file is a Java program packaged as an archive. To run it you need a Java runtime installed; to look inside it, rename it to .zip and extract it, because a JAR is a ZIP file.

What a .jar file actually is

JAR stands for Java ARchive. Structurally it is an ordinary ZIP containing compiled .class files, resources, and a META-INF/MANIFEST.MF that tells Java which class to start.

That dual nature is the whole confusion. "Opening" a JAR means two completely different things depending on whether you want to run the program or inspect its contents, and most guides only answer one of them.

Why it will not open

Windows has no Java runtime out of the box, so double-clicking a JAR does nothing or opens the "how do you want to open this file" dialog. If Java is installed but the JAR still will not launch, Windows has usually associated .jar with an archiver such as WinRAR, so the file opens as a folder instead of running.

Step by step

Windows

  1. 01To run it: install a Java runtime, then double-click the .jar file.
  2. 02If nothing happens, open a terminal in the file's folder and run: java -jar filename.jar. This shows the actual error instead of failing silently.
  3. 03If it opens in WinRAR or 7-Zip instead of running, right-click, choose "Open with" then "Choose another app", and select the Java platform binary.
  4. 04To inspect it instead: right-click, open with 7-Zip, and browse the contents directly. No renaming needed.

macOS

  1. 01Install a Java runtime, for example "brew install --cask temurin".
  2. 02Run "java -jar filename.jar" in Terminal.
  3. 03If Gatekeeper blocks it, go to System Settings, Privacy & Security, and allow it there.

What usually goes wrong

Minecraft mods and OptiFine

Mod installers are JARs and are the single most common reason people search this. Run them with "java -jar" rather than double-clicking, because the double-click path is what breaks when an archiver has claimed the file association. OptiFine in particular needs the matching Minecraft version already installed and launched once.

A JAR can contain anything

Because a JAR is executable code, running one from an untrusted source is exactly as risky as running an .exe. Inspect it with an archiver first if you did not get it from the project itself.

Programs that open .jar

Our pick, in order. Every one links to the publisher's official download URL and the SHA-256 hash of the installer, so you can check the file before you run it.

Also registers .jar in its manifest

Taken straight from publisher manifests. Some of these handle the format for a narrow purpose rather than as their main job.

Common questions

Why will my .jar file not open when I double-click it?
Either no Java runtime is installed, or the .jar extension has been associated with an archiver like WinRAR so Windows opens it as a folder. Running "java -jar filename.jar" from a terminal bypasses both problems and shows the real error.
Can I open a JAR file without Java?
You can inspect it without Java, because a JAR is a ZIP archive: 7-Zip will list and extract its contents. You cannot run the program without a Java runtime.
Is a JAR file the same as a ZIP file?
Structurally yes. A JAR is a ZIP with a specific internal layout and a manifest that names the entry-point class. Any ZIP tool can read one, which is why renaming a .jar to .zip works.

Related formats