Stephen Ostermiller's Blog

Opening .jar Files

The jar file format is common for distributing programs and libraries that are written in Java. Jar stands for Java Archive. Your browser may download Java applets in a .jar file or you may get a .jar file that contains a Java application that needs to be run. The file format is also by Mozilla and Firefox as the format for XUL applications, plugins, and skins.

The jar file format is a container and compression file format. Each jar file compresses and contains other files. Jar files are very easy to open. There are many programs that will act as an opener for jar files. In fact, any program that can open zip files can open jar files. The jar format is identical to the zip file format.

Step by step instructions for how to open jar files and see the contents:

  1. Install software that can decompress and extract files from zip files. (7 Zip is a highly recommended free extraction and decompression program for Windows.
  2. Rename the .jar file to have a .zip extension (if your download program does not recognize .jar files)
  3. Open the file with your decompression program.

Even though jar files are in the same format as zip files, they have a different extension for a reason. A jar file usually contains source code or runnable software and the jar file can be made to be executable. When a file has a .jar extension, it should be associated with the Java runtime environment. When a user double clicks on a jar file, the Java runtime environment will open the jar file and run the software that is contained in it rather than list the files that it contains.

Step by step instructions for opening a jar file and executing the program contained in a jar file:

  1. Install the Java runtime environment if it is not already installed.
  2. Double click on the jar file or use the command line java -jar <myjarfile.jar> (will only work for executable jar files. Not all jar files are executable)

To summarize: A jar file can be opened either with decompression software that can handle zip files or Java can open the jar file and run the Java software that it contains.

Leave a comment

Your email address will not be published. Required fields are marked *