9.1.1.4. Java archives
The GNU project provides us with the jar
tool for creating Java archives. It is a Java application that
combines multiple files into a single JAR archive file. While also
being a general purpose archiving and compression tool, based on
ZIP and the ZLIB compression format, jar was
mainly designed to facilitate the packing of Java code, applets
and/or applications in a single file. When combined in a single
archive, the components of a Java application, can be downloaded
much faster.
Unlike tar, jar
compresses by default, independent from other tools - because it is
basically the Java version of zip. In
addition, it allows individual entries in an archive to be signed
by the author, so that origins can be authenticated.
The syntax is almost identical as for the tar command, we refer to info
jar for specific
differences.
|
tar, jar and symbolic
links |
|
One noteworthy feature not really mentioned in the standard
documentation is that jar will follow
symbolic links. Data to which these links are pointing will be
included in the archive. The default in tar
is to only backup the symbolic link, but this behavior can be
changed using the -h to tar.
|