10 Jar
10 Jar
Name: Calculator.class
lines describing this file
Name: edu/weber/mypkg
lines describing this package
Manifest Contents
Attribute/Value pairs
Note Java-Bean attribute in example:
Name: StockBroker/Simulator/Stock.class
Digest-Algorithms: MD5 SHA
MD5-Digest: wuXrtYN-56Nn4rtDFewq=-tr
SHA-Digest: fg67tKdkfR65-SRkdrslegvY-tyK
Java-Bean: True
Custom Manifest File Indicating Beans
Manifest-Version: 1.0
Name: StockBroker/Simulator/Stock.class
Java-Bean: True
Name: StockBroker/Simulator/Helper.class
Java-Bean: False
Name: StockBroker/Simulator/Price.class
Java-Bean: True
Creating the Archive File
create an archive file with a customized manifest file by using both the m
and f options and giving the required arguments as shown in the slide.
The generated manifest.mf file in the archive should have the information
given in Simulator.mf (which you write).
>jar cfm Simulator.jar Simulator.mf
StockBroker/Simulator/Stock.class
StockBroker/Simulator/Helper.class
StockBroker/Simulator/Price.class
if the jar options contain both the letters f and m, the JAR and manifest
files listed in the command line should be in the same order. For example,
if f comes before m, the JAR filename should come before the manifest
filename.
Examples
See Composites using a jar at:
http://acad.kutztown.edu/~spiegel/cis421/Composite/JAR/
jar contains three classes
ButtonPanel.class
RadioPanel.class
Test1.class (code; this class is used to start applet)
See Animation Demo using a jar at:
http://acad.kutztown.edu/~spiegel/cis421/Animation/AppletJAR/ball.htm
inner classes specified in a manifest