 |
 |
|
|
|
Creating the JAR File
Whenever you compile the unmodified applets samples, modify and rename
the applets, or customize the samples, or create your own Java applets
or applications, you must create a Java Archive (JAR) file to contain
the compiled classes for deployment. (See Sun
Microsystems JDK documentation for information on using the Java Archive
tool.)
Note: The following procedure assumes you
have already compiled the samples without compiler errors (for information,
see Compiling the Java Files).
To create a JAR file, for example for the sample Java Step Processor,
use the following procedure:
- Open a command prompt, and cd to the parent
directory of the directory containing your application/applet; for example
for the Step Processor sample, cd to the parent ...\Developer Files
directory).
- Create a JAR file containing only the compiled classes (and related
information class and image files) by entering a command similar to
the following (assumes using the JDK 1.3.1 installed by PJAC; modify
for the appropriate JDK, images, etc.):
C:\jdk1.3.1\bin\jar.exe -cvf sample.jar samples\vwpanel\samplestep\*.class
samples\vwpanel\samplestep\resources\*.class samples\vwpanel\samplestep\images\*.class
samples\vwpanel\samplestep\images\*.gif
The output you receive should be similar to the following:
added manifest
adding: samplestep\VWSampleStepApplet.class(in = 2617) (out= 1297)(deflated
50%)
adding: samplestep\VWSampleStepApplication.class(in = 3090) (out=
1542)(deflated 50%)
adding: samplestep\VWSampleStepPanel.class(in = 4222) (out= 2053)(deflated
51%)
adding: samplestep\resources/VWResource.class(in = 437) (out= 299)(deflated
31%)
adding: samplestep\images/VWImageLoader.class(in = 1239) (out= 602)(deflated
51%)
adding: samplestep\images/icon.gif(in = 1432) (out= 1015)(deflated
29%)
adding: samplestep\images/step.gif(in = 1592) (out= 1260)(deflated
20%)
- Once the classes are added to the JAR file, deploy
the JAR file on the .NET Web server.
Note: You must sign
the JAR file (using the Netscape Object Signing Certificate).
If you intend to use several JAR files, you should add all of the compiled
files into a single JAR file and deploy just that one file. Alternatively,
you can specify multiple JAR files using a comma (",")
delimiter (however, be aware that not all browsers support multiple JAR
files). If you plan to use several JAR files, you should place each JAR
file in the same directory as the ASPX file that contains the applet.
|