How to Extract a JAR File: 4 Steps (with Images)

Table of contents:

How to Extract a JAR File: 4 Steps (with Images)
How to Extract a JAR File: 4 Steps (with Images)
Anonim

A JAR file is a collection of files compressed with Java tools. Java developers typically pack their Java applications and applets into a single JAR file to simplify deployment. This format is generally used with software that is portable, or rather runs on multiple operating systems. This guide will help you extract and view the contents of these files.

Steps

Extract a JAR File Step 1
Extract a JAR File Step 1

Step 1. Verify that the Java SDK is installed (Java Platform Standard Edition Development Kit)

One version is included with Oracle's JDeveloper. It can be downloaded from Sun's website directly.

Extract a JAR File Step 2
Extract a JAR File Step 2

Step 2. Find the jar.exe file in the Java SDK folder

It is normally located in the "bin" folder of the SDK. A classic path is "C: / Program Files / Java / jdk1.x.x_xx / bin" with x.x._xx reflecting the JDK version. New versions may have the default path set to C: / Sun / SDK / jdk / bin.

Extract a JAR File Step 3
Extract a JAR File Step 3

Step 3. Open Command Prompt or Terminal, depending on your operating system, and navigate to the bin folder

Example for windows: type cd c: / programs / java / jdk1.6.0_05 / bin to access the bin folder.

Extract a JAR File Step 4
Extract a JAR File Step 4

Step 4. Run jar.exe

Use the "x" and "f" parameters to extract the file from the archive. Example: jar xf ilmiofile.jar will extract all the folders and files of the ilmiofile.jar file in the current folder.

Advice

  • Firefox 3.0 can also browse JAR files, starting the file as "jar: file:" and ending it with ".jar! /".
  • JRE is the runtime environment which does not include the jar.exe file and other Java tools as found in the JDK.
  • All JAR files will automatically open within a Java Integrated Development Environment (IDE), such as JDeveloper. To use these files outside of the IDE, you need to save them in a different location.
  • JDeveloper will put the jar.exe file in the jdk / bin folder.
  • Use the -C parameter to extract to a different location. Example: jar xf MyDownloadedFile.jar -C "C: / Documents and Settings / mylogin / My Documents"
  • Many cross-platform applications access JAR files on the fly, so decompression before accessing the resources within these files may not be necessary. A famous example is Mozilla Firefox which uses Chrome to read from the JAR file.

Recommended: