E.20. Creating a .jar File

A .jar file (Java Archive) uses the same algorithm as a Zip utility does to compress numerous documents into one archive document. The benefit of a .jar file is that the developer can combine HTML, applets, class files, images, sounds, and everything else that makes up an application and put them all into a .jar to facilitate easy distribution of the application. The .jar tool is a Java application tool, regularly available with the SDK.

To create a new .jar:

1.
Navigate to the directory in which you want to create the .jar
2.
Type at the command line: jar cf myJar *.class

To add all of the files in a particular directory to the .jar:

1.
Navigate to the directory in which you want to create the .jar
2.
Type at ...

Get Java™ for ColdFusion® Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.