Before developing your own Bean, it is necessary for you to understand JAR (Java
Archive) files, because tools such as the BDK expect Beans to be packaged within JAR  files. A JAR file allows you to efficiently deploy a set of classes and their-associated resources, For example,a developer may build a multimedia application that Uses various sound and image files. A set of Beans can control how and when this information is presented: All of these pieces can be placed into one JAR file. JAR technology makes it much easier to deliver and install software. Also, the elements in a JAR file are compressed, which makes downloading a JAR file much faster than separately downloading several uncompressed files, Digital signatures may also be associated with the individual elements. in a JAR file. This allows a consumer to be sure that these elements were produced by a specific organization or individual.

Manifest Files

A developer must provide-a manifest lac to indicate which of the components in a JAR file are Java Beans. An example of a manifest file is provided in the following. Listing. It .defines a JAR file that contains four .gift files and one .class file. The last entry is a Bean.

A manifest file may reference several.class files. If a .class file is a Java Bean, its entry must be immediately followed by the line “Java-Bean: True”.

Tabulating the Contents of a JAR File
The following command. lists the contents of Xyz.jar

jar tf Xyz. jar

Extracting Files from a JAR File

The following command extracts the contents of Xyz.jar and places those files in the
current directory:

Ijar xf Xyz.jar

Updating an Existing JAR File
The follo~ing command adds the file filet.class to Xyz.jar:
Ijar -u~ xyz:ja~ file1.class
. .
Recursing Directories
The following command adds all files below directoryX to Xyz.jar:
Ijar _ufo xyz , jar -C directoryX


  • Feel free to send us an inquiry, we will reply back in hours.


Posted on September 18, 2014 in Java Beans

Share the Story

About the Author

Back to Top