Sunday, 11 October 2015

What is JAR, how differ to zip file?

JAR: Jar stands for Java Archive.

A jar file usually has file name extension .jar. It contains mainly java class files but any types of files can be included, e.g., XML files, HTML files, properties files, gif/jpg image files, text files, PDF files, and binary files, and so on.

What is the difference between a jar file and a zip file?

Basically, a jar file is the same as a zip file, except that the jar file contains a META-INF directory to store metadata or attributes.

The most well-known file is META-INF/MANIFEST.MF. You can customize the content of a MANIFEST.MF when creating a jar file, and if you don't, a default one is generated and included.

For example:
Manifest-Version: 1.0
Created-By: 1.5.0_06 (Sun Microsystems Inc.)
It's perfectly fine to have other configuration files and directories under META-INF.

Advantages of JARs:

This greatly improves the speed with which an applet can be loaded onto a web page and begin functioning. The JAR format also supports compression, which reduces the size of the file and improves download time still further.


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...