Have you ever wondered why that are so many file extensions ending in "
a r"? It's because the "ar" stands for archive, and it's such a reasonable way of naming file that the original
tar which stands for
tape archive was picked up by Sun and the Java community and transmuted into other file formats.
tar - tape archive
jar - java archive
war - web application archive
ear - enterprise archive
sar - service archive
The original
tar or tape archive files are / were used for software distribution and backups. The format they use is that the file is written as a series of units:
• file name
• file length
• file data
which means that the whole archive file has potentially to be scanned when an element is to be extracted. Furthermore, a tar file in its native form is NOT compressed in any way. This means that a tar file can be both big and inconvenient.
Jar or Java Archive files may also be used for software distribution and backups, and although the jat utility that's used to create and (usually) to unpack them is written in Java and most people use them to contain Java - related information, they can actually contain any file and directory structure. There IS a header (an index or MANIFEST) at the top of a jar file saying what's in the file and where it is, so things can be accessed quickly on a random access systems such as a disc drive, and the data is usually stored compressed (turn compression off with the
0 option when you create a jar). This means that a .jar file is an appropriate medium for extracting information on the fly within a live application, even one that's quite heavily used.
Other file types that I mentioned at the start, such as
war and
ear are also jar files, created with the jar utility. In fact, they're a subtype of jar files with the data they contain being in a specific file and directory stucture. In other words, the arrangment of files within a
war is such that the file and its contents are suitable for deployment as a webapp under a container such as Apache Tomcat, and the arrangement of files within a
ear is such that it's an Enterprise Archive such as you would use under JBoss, etc.
(written 2006-06-10, updated 2006-06-13)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
J951 - Java - Tomcat - Configuring Web ApplicationsJ708 - Java - Packages [2114] Which Version of Java am I running? - (2009-04-02)
[2419] Where is my Java class? - (2009-09-24)
[2865] Relationships between Java classes - inheritance, packaging and others - (2010-07-10)
A802 - Web Application Deployment - The JBoss application serverA653 - Web Application Deployment - Tomcat - Configuring Web Applications [465] Changing Tomcat's web.xml and reloading a web application - (2005-10-15)
[479] New servlet from old - (2005-10-28)
[1006] Apache httpd and Apache Tomcat together tips - (2006-12-24)
[1074] Java beans and classes, .war and .jar files - (2007-02-10)
[1082] Straight from the .jar - (2007-02-16)
[1192] What are WEB-INF and META-INF directories? - (2007-05-18)
[1552] Extra public classes in deploying Apache httpd and Tomcat - (2008-02-24)
[1564] Default file (MiMe types) for Apache httpd and Apache Tomcat - (2008-03-04)
[1909] javax.servlet cannot be resolved - how to solve - (2008-11-26)
[2088] Changing the 404 - file not found - page in Tomcat - (2009-03-18)
[3044] Changing a Servlet - more that just editing and compiling - (2010-11-12)
[3996] Tips on Tomcat - moving applications around - (2013-02-05)
A502 - Web Application Deployment - Java - Basic Tools [1562] Java Compiler - needs all classes, compiles them all too - (2008-03-03)
[1771] More HowTo diagrams - MySQL, Tomcat and Java - (2008-08-24)
[2153] Class Loading and Variable Conversion in Java - (2009-05-02)
[2422] Looking inside Java classes - javap and javadoc - (2009-09-25)
[2859] Using java, javac, jar, and CLASSPATH - a simple example - (2010-07-07)
[3151] Disassembling Python and Java - previously compiled code - (2011-01-29)
[3819] Packing a tar, jar or war file - best practise - (2012-07-26)
[4412] Java -making sure you have the right versions - (2015-02-02)
A162 - Web Application Deployment - Backups and File System Management [153] Linux - where to put swap space - (2004-12-16)
[334] Symbolic links and hard links - (2005-06-02)
[554] What backup is adequate? - (2006-01-04)
[593] Finding where the disc space has gone - (2006-02-06)
[703] Copying files and preserving ownership - (2006-04-28)
[735] Boys will be boys, saved by Ubuntu - (2006-05-27)
[1013] Copy multiple files - confusing error message from cp - (2006-12-30)
[1023] Finding public writeable things on your linux file system - (2007-01-06)
[1288] Linux run states, shell special commands, and directory structures - (2007-08-03)
[1439] Linux / Unix - layout of operating system files - (2007-11-20)
[1648] The tourists guide to Linux - (2008-05-20)
[1765] Dialects of English and Unix - (2008-08-21)
[1801] Will your backups work if you have to restore them? - (2008-09-18)
[1893] Some Linux and Unix tips - (2008-11-18)
[2299] How much space does my directory take - Linux - (2009-07-20)
[4056] An overpractical test of our backup strategy! - (2013-03-30)
[4063] Backups by crossover between network centres - setting up automatic scp transfers - (2013-04-13)
[4115] More or less back - what happened to our server the other day - (2013-06-14)
[4390] Checking MySQL database backups have worked (not failed) - (2015-01-10)
[4400] Commenting out an echo killed my bash backup script - (2015-01-19)
[4405] Backup procedures - via backup server - (2015-01-24)
[4481] Extracting data from backups to restore selected rows from MySQL tables - (2015-05-01)
Some other Articles
Very good for woodliceHorse and Python trainingSeeing the bricks for the treesUsing different URLs to navigate around a single scripttar, jar, war, ear, sar filesPython 3000 - the next generationOver zealous police activity?Want to be a technical trainer in the UK?Almost everyone losesCottage industry or production line data handling methods