A .jar file (Java Archive) uses the same algorithm as a Zip utility does to compress numerous documents into one archive document. The benefit of a .jar file is that the developer can combine HTML, applets, class files, images, sounds, and everything else that makes up an application and put them all into a .jar to facilitate easy distribution of the application. The .jar tool is a Java application tool, regularly available with the SDK.
To create a new .jar :
Navigate to the directory in which you want to create the .jar
Type at the command line: jar cf myJar *.class
To add all of the files in a particular directory to the .jar :
Navigate to the directory in which you want to create the .jar
Type at the command line: jar cvf myApp.jar
Top |