Using JAR- the Java Archive Tool

The jar tool is used in combining multiple files into one JAR file. JAR is a general-purpose archiving and compression tool, based from ZIP and Zlib compression format, but is designed mainly to facilitate the packaging of java applets or applications into a single archive.

Typical usage of jar is:

Within the directory of your classes, run:

% jar cf myArchive.jar *.class

This creates a new JAR file named myArchive.jar containing all your classes

If you have an existing Manifest file whose name: value pairs you want the jar tool to include for the new jar archive, you can specify it using the m option:

% jar cmf myManifestFile myArchive.jar *.class

To extract JAR Files, you command x:

% jar xf myArchive.jar

However, if you need to extract specific files, supply their filenames as argument/s:

% jar xf myArchive.jar foo1 foo2 bar1 bar2

 

Advertisements

Congratulations Manny Pacquiao!

 Manny PacquiaoCongratulations to our very own Manny “Pacman” Pacquiao for winning the fight against Antonio “Tijuana Tornado” Margarito of Mexico. Even if winning in a unanimous decision, this is our hero’s 8th winning world title, added is the WBC Junior Middleweight Champion title. Again, congratulations Manny,you make our country proud.