O'Reilly logo

Java™ Phrasebook by Timothy Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Archiving Classes with Jar

jar cf project.jar *.class

The jar utility is included with the JDK, and is used to package groups of classes into a bundle. Using the jar tool, you can create, update, extract, list, and index a JAR file. In this phrase, all the classes contained in the current directory from which the jar command is run will be put into a JAR file with the name project.jar. The c option tells the jar utility to create a new archive file. The f option is always followed by a filename specifying the name of the JAR file to use.

Complete applications can be distributed as JAR files. Applications can also be executed out of a JAR file without having to first extract them. See the phrase “Running a Program from a JAR File” contained in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required