.jar — Java Archive
Oracle (originally Sun Microsystems) · 1995
What is a .jar file?
A JAR (Java Archive) file is a package file format typically used to aggregate many Java class files and associated metadata and resources into one file for distribution. They are essentially ZIP archives with a specific structure and manifest file. JAR files are commonly used for distributing Java applications, applets, and libraries.
Programs That Open .jar Files
| Platform | Program | ||
|---|---|---|---|
| Windows | Java Development Kit (JDK) | Free | Official |
| 7-Zip | Free | ||
| WinRAR | Paid | ||
| macOS | Java Development Kit (JDK) | Free | Official |
| The Unarchiver | Free |
Common Problems with .jar Files
Frequently Asked Questions
A JAR file is used to package Java class files, related metadata, and resources into a single file for distribution, often for applications, libraries, or applets.
Yes, because JAR files are essentially ZIP archives with a specific structure, you can often open them with standard ZIP utilities to view their contents, though they are intended to be run by the Java Virtual Machine.
You can run a JAR file from the command line using the command 'java -jar yourfile.jar', provided you have a Java Runtime Environment (JRE) installed.
Technical Details
A JAR file is essentially a ZIP file, meaning it uses the DEFLATE compression algorithm. It contains a META-INF directory which usually holds a MANIFEST.MF file containing metadata about the archive's contents. The 'PK' signature at the beginning is a hallmark of ZIP-based archives.