.JAR - File Extension for Java Archive Files

Q

File extension JAR is used for Java archive files. A JAR sample file is provided. Free software for creating and opening JAR files are listed.

✍: FYIcenter.com

A

File Extension: .JAR

MIME Type: application/java-archive

File Content: Compressed files

What is JAR? JAR is a short name for Java ARchive, a file format used to archiving Java class files and associated metadata. JAR was developed by Sun Microsystems by extending the ZIP file format.

Some technical notes on JAR file format:

  • JAR file format is an extension of ZIP file format. Most ZIP file tools can handle JAR files without any changes.
  • JAR file format can be used to archive more than just Java class files. Any types of files can be archived into a JAR file.
  • JAR file format support a standard manifest file, MANIFEST.MF, in the META-INF sub directory. The manifest file contains a list of attributes to provide metadata about the JAR file.
  • An executable JAR file can be created with the "Main-Class" attributed defined in the manifest file. Executable JAR files can be executed with the "java -jar" command provided in the JDK package.
  • JAR file format does not support password protection as ZIP file format does.
  • JAR file format supports digital signature to preventing altering any files archived in the JAR file.

JAR is the file extension for JAR files.

JAR files are binary files. Here are the first 64 bytes of a sample JAR file dumped in HEX values:

50 4b 03 04 14 00 08 00 08 00 90 b8 24 38 00 00 PK...........8..
00 00 00 00 00 00 00 00 00 00 0d 00 04 00 57 65 ..............We
6c 63 6f 6d 65 2e 63 6c 61 73 73 fe ca 00 00 6d lcome.class....m
50 c1 4a c3 40 10 7d d3 24 4d 1b a3 ad ad ad 56 P.J......M.....V

Notice that JAR files share the same magic number, "PK", with ZIP files.

JAR sample file: Click sample.jar to download.

JAR files can be created and unpacked by many free compression software:

  • Java SE - Java Development Kit with a command line tool to create and unpack JAR files.
  • FREE Unzip Utility for Windows - Opens ZIP files, developed by PKWARE.
  • FreeZip - Creates and edits ZIP files.
  • Info-ZIP - Creates and edits ZIP files. An open source software.

2012-07-02, 6703👍, 0💬