Monday, 24 March 2014

JAVA JAR FILE

Posted By: Unknown - Monday, March 24, 2014
A JAR (Java ARchive) file is a file that contains the class, image, and sound files for a Java application or applet gathered into a single file and possibly compressed. When a programmer gets a Java program development kit, a small program or utility called “jar” is included. The jar utility lets the programmer create, list, or extract the individual files from a JAR file. In an enterprise, a Java application can be started with a set of JAR files for use during execution. An off-the-shelf open source package can be delivered as a JAR file and run with XML data.
This will allow programmer to bundle multiple files into archive file i.e. JAR file. You can keep all class files, images, packages, xml files ….etc of a complete application. If application involves multiple class and many other files then we can bundle into one file i.e. Java Jar file.
Jar file utility is the part of JDK. It allows you to create Jar file, view files in jar file, extract files from Jar file and add files into jar file. Jar files also can be made as executable jar file which you can place into Desktop and double click to run the application.
Jar files provides many other feature or benefit parts of compression :
1. You can sign your jar file as digital signature. This is security benefit of jar
2. Jar file hold information about its version and its vendor.
3. Since Everything is bundled in one archive file then it takes less time in downloading. Portability is easy.
Here we have following basic of jar file :
Jar utility is built in feature in JDK. It is included in JDK. You can do following basic operation in jar file
1. Creating a jar file: -C option is used for creating jar file
jar cf JarFileName InputFiles
2. Viewing of files in jar : -T options shows files containing by jar file in tabular format
jar tf JarFileName
3. Extract files from Jar file : -X option extract files from jar file.
jar xf JarFileName Files
4. Execution of specific file (class file) in jar file : We can execute jar file by executing any specific class file which is included in jar file. We can use manifest file for the same.
java -jar Application.jar
Following are all options available in jar utility :
Options:
    -c  create new archive
    -t  list table of contents for archive
    -x  extract named (or all) files from archive
    -u  update existing archive
    -v  generate verbose output on standard output
    -f  specify archive file name
    -m  include manifest information from specified manifest file
    -e  specify application entry point for stand-alone application
        bundled into an executable jar file
    -0  store only; use no ZIP compression
    -M  do not create a manifest file for the entries
    -i  generate index information for the specified jar files
    -C  change to the specified directory and include the following file

0 comments:

Post a Comment

this blog is helpful or not

International

Auto News

Translate

Pages

Popular Posts

Popular Posts

Designed By Templatezy / Sb Game Hacker Apk / MyBloggerThemes