In the Application Program Use archive in the neutralization applets Applet
Thank you for the jar enhancement feature provided by Java 1.2. You can now run the archived applets and applications. For example, if you send a-jar command to the Java interpreter, you can run archived applications. Java applications packaged and compressed in jar files can be directly executed on Windows or Solaris desktops.
The automatic execution of these archives depends on the system you are using. After you install the Java 1.2 runtime environment in a 32-bit Windows system, the installer registers a default JAR file connection. Then, you can use the-jar option to call the Java interpreter to automatically run the JAR file. For the Solaris 2.6 operating system, Sun actually extends the kernel of the operating system so that the system can identify the JAR file. The extended part of the kernel allows Solaris 2.6 to directly call the Java interpreter through the-jar option, so that the Solaris system can execute the archive file in the same way as the native Solaris executable file.
The Java applets running archived are different from those running archived, because you need to tell the Java applet viewer or a Java browser how to use the applet. Generally, you can create a webpage that contains the <APPLET> identifier. The relevant property value of this identifier tells you about the applet in the browser, such as its class name and position.
With the <APPLET> identifier, You can associate one or more archives with the applet. When you use archive files in a applet, the browser always looks for the required classes and resource files in archives. If the browser cannot find these files in archives, the browser tries to obtain these files from the server. This is also the case if archives does not exist.
To indicate in the applet that the attribute of Java archive is archive. Attribute archive is always used together with the code attribute. The Code attribute indicates the name of the main Applet Class, and the archive attribute indicates the location of the archive file, which can be defined by relative or absolute URLs. For relative URLs, your browser uses the AppletCodeTo determine the location of the archive file. Do you recall that the root directory where the code is located is the applet'sSource codeLocation, which can be marked with the codebase attribute.
In the following example, the main Applet Class is MyApp. class, And the browser searches for it in the corresponding property file. If the browser cannot find the Applet Class, the browser will go to the server to find the Applet Class.
<APPLET code = "MyApp. Class" ARCHIVE = "MyApp. Jar" width = "250" Height = "250">
</APPLET>
If an applet uses more than one archive, you can enter the URL of the archives file in the list separated by commas. In the following example, the applet uses two archives files. The first archive is named strider1.jar, and the second archive is named strider2.jar.
<APPLET code = "Strider. Class" ARCHIVE = "strider1.jar, strider2.jar" width = "300" Height = "300">
</APPLET>