Thursday, January 22, 2015

What Is A Jar File

A JAR file is a special file used by Java. JAR is an acronym for Java ARchive file. These files must be specified in the Java classpath for them to be used. The classpath variable tells Java where to look for classes when a Java program is started.


Significance


JAR files are similar to ZIP files; they are both compressed archives. Both JAR and ZIP can be used by Java. There are Java classes that allow the programmer to look into JAR and ZIP files to see what classes are included in the archive.


Function


JAR files contain compiled Java classes. When a Java program is started, Java searches the JAR and ZIP files that appear in the classpath looking for all classes that are needed by the program.


Features


JAR files are part of what makes Java portable. A JAR file that is used on a PC can also be used on a mainframe computer without recompiling.


Usage


JAR files are built with a Java utility called "Jar." Running the Jar utility lets the user add or delete files from the archive or extract the files into a sub-directory tree.


Benefits


JAR files aid developers in delivering program changes and bug fixes. A single JAR file with changes can be sent to users without having to send the entire Java program.


Expert Insight


Some software manufacturers include an extra JAR filename in the classpath. This allows a temporary fix to be delivered without having to change the classpath entry.

Tags: Java program, classes that, Java classes, Java program started, program started, used Java, without having