What Is a .JAR File?

A .jar file is a Java Archive: a ZIP-based package of compiled Java classes, resources and a manifest. Some JARs are runnable programs started with Java; others are libraries used by other Java programs. Minecraft mods, Minecraft servers and many developer tools are distributed as JAR files.

Extension
.jar
Full name
Java Archive
Type
System and app file
MIME type
application/java-archive
Developed by
Sun Microsystems (now Oracle)

About JAR files

A JAR is a ZIP archive with a META-INF/MANIFEST.MF file describing it. If the manifest names a Main-Class, the JAR is executable: with Java installed, java -jar file.jar starts it, and on some systems a double-click does the same. Library JARs have no main class and do nothing on their own.

Java is no longer bundled with Windows or macOS, so you need a Java runtime, such as Eclipse Temurin or Oracle Java, at the version the program requires. Version mismatch errors such as UnsupportedClassVersionError mean the JAR needs a newer Java. Minecraft: Java Edition's launcher includes its own runtime.

A runnable JAR is a real program with the same access to your files as any app, so treat JAR downloads like .exe files. Malicious Minecraft mods distributed as JARs have stolen account credentials and browser data. Download mods and tools only from the official project pages or well-known repositories, and keep Java up to date.

What JAR files are used for

  • Minecraft: Java Edition mods and servers
  • Cross-platform desktop tools that run anywhere Java is installed
  • Java libraries used by developers through Maven or Gradle
  • Server applications and plugins

How to open a .jar file

Windows

Install a Java runtime such as Eclipse Temurin, then double-click a runnable JAR or run java -jar file.jar in Terminal. 7-Zip opens it as an archive to inspect.

Mac

Install a Java runtime, then run java -jar file.jar in Terminal. macOS may block unsigned JARs; only approve them from trusted sources.

Linux

Install OpenJDK from your package manager and run java -jar file.jar.

Minecraft mods

Do not run mod JARs; place them in the mods folder of a Forge, Fabric or NeoForge installation via the launcher.

How to convert a .jar file

A JAR cannot be converted into a normal .exe by renaming. Developers can package Java apps as native installers with the jpackage tool included in the JDK.

Renaming a copy to .zip lets you extract its contents; the classes inside are compiled bytecode, not readable source.

Changing the extension in the file name does not convert the file. See how to change a file extension for when renaming is safe.

Naming and renaming JAR files

  • Keep the version in JAR names (sodium-fabric-0.5.11-mc1.21.jar); mod loaders and developers rely on it to spot conflicts.
  • When a JAR depends on others, keep them in a folder named after the program so the classpath stays simple.
  • Do not rename Minecraft mod JARs to disable them unless the loader supports it; move them out of the mods folder instead.

Renaming lots of .jar files? Use the free online bulk renamer for patterns and numbering, or try File Renamer AI to name each file from what is inside it.

Related file types

Frequently Asked Questions

How do I run a JAR file?

Install Java, then double-click it or run java -jar filename.jar in a terminal. If nothing happens, it may be a library, not a program.

Is a JAR file safe?

A runnable JAR can do anything a program can, so only run JARs from trusted sources, including Minecraft mods.

Why does my JAR say UnsupportedClassVersionError?

It was built for a newer Java version. Install the Java version the developer lists.

How do I open a JAR file to see what is inside?

Open it with 7-Zip, or rename a copy to .zip and extract it.

More system and app file extensions · all file extensions