Top
Interstage Studio J Business Kit User's Guide
FUJITSU Software

2.3.9 Starting a Java VM in Advance

This section describes the method of starting a Java VM in advance before starting an applet, by using JBK Plugin.

Generally, when an applet is first executed on a browser, a Java VM is started. It takes several seconds to start a Java VM. During that time, the browser may not accept any operation from the user, and the user may have to wait until the activation of the Java VM is completed. To prevent this situation, JBK Plugin provides the functionality of starting a Java VM in advance, without executing an applet, when the HTML file is coded accordingly. With this functionality, the Java VM can be started before an applet is started, and the user does not have to wait.

How to Create an HTML File for Starting a Java VM in Advance

When using JBK Plugin to start a Java VM in advance without executing an applet, code the name of the applet (NAME attribute) as "@JAVAVMONLY" in the HTML file for JBK Plugin. For the coding of the HTML file for JBK Plugin, see '2.2.3 How to Create an HTML File for JBK Plugin'.

If the NAME attribute is specified as "@JAVAVMONLY," JBK Plugin disables the corresponding CODE attribute and starts a Java VM in advance in the background.

Example

Sample coding for starting a Java VM in advance

When starting a Java VM in advance by using JBK Plugin, include the following in the HTML file :

<OBJECT CLASSID="CLSID:BEA62964-C40B-11D1-AACA-00A0C9216A67" WIDTH=1 HEIGHT=1>
    <PARAM NAME="TYPE" VALUE="application/x-JBK-Plugin">
    <PARAM NAME="NAME" VALUE="@JAVAVMONLY">
</OBJECT>

Point

Required Attributes of the Tag

  • If the NAME attribute is specified as "@JAVAVMONLY," the corresponding CODE attribute is unnecessary.

  • If the NAME attribute is specified as "@JAVAVMONLY," the corresponding section is displayed as a rectangle having the width and height specified by WIDTH and HEIGHT on the browser screen. The user is recommended to specify 1 as both the WIDTH attribute and the HEIGHT attribute so that the rectangle does not stand out on the screen.

How to Start a Java VM in Advance

To start Java VM in advance, follow these steps:

  1. Creating an HTML file for starting a Java VM in advance

    1. In addition to an HTML file for executing an applet, create an HTML file for starting a Java VM in advance, according to the above description. This HTML file can be used to process any operations needed before the execution of an applet.

      • displaying the title page of the application

      • displaying a notice

      • user's input request, etc.

    2. The specification of "How to Create an HTML File for Starting a Java VM in Advance" is described in this HTML file. Then this HTML file will be the HTML file for starting a Java VM in advance.

  2. Executing the HTML file

    1. When the user starts the browser, he should display the HTML file for starting a Java VM in advance. While the user is doing some operations in the HTML file, JBK Plugin starts the Java VM in the background. The activation of the Java VM will not interfere with the processing on the browser screen.

    2. The user finishes the operation and then displays the HTML file for executing the applet. Since the Java VM has already been started, JBK Plugin downloads and starts the applet immediately. The user does not have to wait until the activation of the Java VM is completed.

Note

The HTML file for starting a Java VM in advance should not include the coding for executing an applet for JBK Plugin. If the HTML file contains a coding for executing an applet, the coding for starting a Java VM in advance in the HTML file becomes invalid.

Example

Sample HTML file for starting a Java VM in advance

The sample coding of an HTML file for starting a Java VM in advance is shown below:

<HTML>
<HEAD>
<TITLE>An Example HTML file for starting a Java VM in advance</TITLE>
</HEAD>

<BODY>
<!--
  This tag is shown as an 1x1 rectangle with the same color as the
  background color of the browser window.
-->
<OBJECT CLASSID="CLSID:BEA62964-C40B-11D1-AACA-00A0C9216A67" WIDTH=1 HEIGHT=1>
  <PARAM NAME="TYPE" VALUE="application/x-JBK-Plugin">
  <PARAM NAME="NAME" VALUE="@JAVAVMONLY">
<OBJECT>

</BODY>
</HTML>