| This Chapter | |
| - | Appendix C: jar |
| - | Syntax |
| - | Options |
| - | Examples |
| - | Setting an Application’s Entry Point |
jar, short for Java archive, is a tool to package Java class files and other related resources into a jar file. The jar tool is included in the JDK and initially the reason for its creation was so that an applet class and its related resources could be downloaded with a single HTTP request. Over time, jar became the preferred way of packaging any Java classes, not only applets.
The jar format is based on the zip format. As such, you can change the extension of a jar file to .zip and view it using a ZIP viewer, such as WinZip. A jar file can also include the META-INF directory for storing package and extension configuration data, including security, versioning, extension and services. jar is also the only format that allows you to digitally sign your code.
Note
More information on the jar file can be found at http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html
This appendix provides the syntax of the jar tool and examples of how to use it.