What is a JAR file in Java

In this section, you will read about the jar file.


 

Ads

Tutorials   
How to read properties file in Java? Generate random numbers in Java Cloneable Interface in Java What is the flaw with the Stack class? List In Java Java Stack Example HashSet In Java Enumeration in java How to generate random number in java Iterator in java Queue in java Transient Java Keyword clone method in Java Java Queue example Logger in Java Java current date - How to get current date in Java Collection : LinkedList Example Collection : ArrayList Example Random alpha numeric string of fixed size Java List Iterator Example The Hashtable Class The BitSet class Java Vector Java Enumeration Data Structures in Java Java Transient Variable Java Date Format Example Java Properties File Example Map.Entry Java Interface Java Property File java preferences,Change the value of Preferences by user Retrieving a Preference Node Java hasNext Write Keys and Values to the Properties file in Java Get All Keys and Values of the Properties files in Java Properties file in Java Properties file in Java Determining If a Preference Node Contains a Specific Value Change the value of Preferences by user Clone method example in Java Implementing a Simple Event Notifier Determining When a Preference Node Is Added or Removed Listening for Changes to Preference Values in a Preference Node Importing Preferences Finding a Preference in a Preference Tree Retrieving the Parent and Child Nodes of a Preference Node Determining If a Preference Node Exists Removing a Preference Node Creating a Preference Node Getting the Maximum Size of a Preference Key and Value
Ads

What is a JAR file in Java

     

JAR file is the compressed file format. You can store many files in a JAR file. JAR stands for the Java Archive. This file format is used to distribute a set of java classes. This file helps you to reduce the file size and collect many file in one by compressing files. Downloading the files are become completed in very short duration of time because of reducing the file size. You can make the jar file executable by collecting many class file of your java application in it. The jar file can execute from the javaw (Java Web Start).

The JAR file format is based on the popular ZIP file format. Usually these file format is not only used for archiving and distribution the files, these are also used for implementing various libraries, components and plug-ins in java applications. Compiler and JVMs (Java Virtual Machine) can understand and implement these formats for java application.

For mentioning the product information like vendor name, product version, date of creation of the product and many other things related to the product are mentioned in the manifest file. Such type of files are special which are mentioned in the jar file for making it executable for the application. This file format is to be used for collecting auxiliary files associated with the components.

To perform basic operations for the jar file there has to be used the Java Archive Tool (jar tool). It is provided by the jdk (Java Development Kit). Following are some jar command which are invoked by the jar tool:

Functions Command
creation a jar file
viewing contents of a jar file
viewing contents with detail of a jar file
extract all the files of a jar file
extract specific files from the jar file
update jar files
running a executable packaged jar file
jar cf jar-file-name file-name(s)_or_directory-name
jar tf jar-file-name
jar tvf jar-file-name
jar xf jar-file-name
jar xf jar-file-name file-name(s)_from_jar-file
jar uf jar-file-name file-name(s)_from_jar-file
java -jar jar-file-name

Advertisements

Share on Google+Share on Google+

What is a JAR file in Java

Posted on: April 16, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: What is a JAR file in Java   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:11
sathish
August 30, 2011
jar files

thank you
raj kumar varma
September 15, 2011
JAR FILE

exact means of jar file
Amzad
January 25, 2013
About ,,,

Blackberry bold 9000 can support jar or jar file....
nikkiedwards
December 3, 2011
hi

hi ,follow me on facebook,,
Loganathan.G
December 7, 2011
About Jar File

The contents given in this chapter is very useful for me. I u/s the about the jar files now.
harish bohra
January 16, 2012
Advance java

How we can make a setup file for my swing application ? plz help me out???
prakash
June 2, 2012
java

what is JAR file explain briefly please?
VAISHNAVI
July 27, 2012
Clarify the Doubt

The JAR format file is use in .NET it is Possible or not
Palanisamy
July 28, 2012
java architecture for xml binding

During compilation I get the error packge javax.xml.bind does not exist. note JAXBExample.java uses or overrides a deprecated API note recompile with -Xlint:deprecation for details. how to remove this error ? I am working in command line prompt.

Ads

 

Ads