Home

This Chapter
-Appendix C: jar
-Syntax
-Options
-Examples
-Setting an Application’s Entry Point

Table of Contents
-Introduction
-Chapter 1: Your First Taste of Java
-Chapter 2: Language Fundamentals
-Chapter 3: Statements
-Chapter 4: Objects and Classes
-Chapter 5: Core Classes
-Chapter 6: Inheritance
-Chapter 7: Error Handling
-Chapter 8: Numbers and Dates
-Chapter 9: Interfaces and Abstract Classes
-Chapter 10: Enums
-Chapter 11: The Collections Framework
-Chapter 12: Generics
-Chapter 13: Input Output
-Chapter 14: Nested and Inner Classes
-Chapter 15: Swing Basics
-Chapter 16: Swinging Higher
-Chapter 17: Polymorphism
-Chapter 18: Annotations
-Chapter 19: Internationalization
-Chapter 20: Applets
-Chapter 21: Java Networking
-Chapter 22: Java Database Connectivity
-Chapter 23: Java Threads
-Chapter 24: Security
-Chapter 25: Java Web Applications
-Chapter 26: JavaServer Pages
-Chapter 27: Javadoc
-Chapter 28: Application Deployment
-Appendix A: javac
-Appendix B: java
-Appendix C: jar
-Appendix D: NetBeans
-Appendix E: Eclipse

Previous
Next

 

Appendix C

jar

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.

Previous
Next