This guide explains why and how to upgrade applets from the
Microsoft Virtual Machine (VM) for Java™ technology to the
Sun Java Runtime Environment (JRE™). In 98% of cases, applets
run unchanged under the Sun JRE. For the remaining 2% of cases,
this document shows how to upgrade. The
results of this upgrade are beneficial, as the Microsoft VM is
based upon version 1.1, an early, 1997 version of Java technology.
The latest, standards-compliant version from Sun Microsystems is
JRE 6, released in December 2006, includes many enhancements over
the early version.
An important reason to upgrade applets is because Microsoft VM does not support or provide a Java technology implementation with any of its products. Microsoft has already discontinued shipping Java technology in the Internet Explorer web browser with the latest versions of its operating systems, which has two important implications:
The Microsoft VM, which is based upon 10 year old Java 1.1 technology, is clearly outmoded. On the other hand Sun Microsystem's VM, which is part of Sun JRE 6, is thoroughly standards compliant and up to date which makes another good reason for upgrading Java applets and applications to run on the Sun JRE.
Microsoft encourages developers to upgrade Java applets and applications to J# or C# languages. But, J# and C# run only in Microsoft Windows platform and do not offer cross-platform compatibility.
To upgrade to the Sun JRE, follow these steps:
Although most applets run correctly in the Sun JRE, always test the applets.
To verify whether you already have the latest Sun JRE installed on your test computer, follow the instruction below:
The Control Panel opens.
You should see the coffee-cup icon labeled Java in the Control Panel. If you do not see the coffee cup icon in the Windows Control Panel, you do not have the latest version of the Sun JRE installed on your computer.
You can download and install the Sun JRE in your computer, from the url: http://java.com/java/download/index.jsp.
After you install the Sun JRE in your computer, you need to validate whether the Sun JRE is enabled for your web browser to run the applets.
To validate whether your web browser uses Microsoft VM or Sun JRE go through the following steps:
The Control Panel opens. You should see the coffee-cup icon labeled Java in the Control Panel.
If 'Show console' is selected in the Java Control Panel (Advanced tab > Java console), the Java Console displays a Java version number, as shown in the next section. The version number indicates the Sun JRE that is being used by the browser.
Run the applet in your web browser to test it. If you have a set of standard tests for running an applet, perform those tests.
If there is a compatibility issue, you will see details about it in the Java Console which pops up on the screen if 'Show console' is selected in the Java Control Panel (Advanced tab > Java console). The following figure shows a sample screenshot of the Java Console:
For details about the Java Console, see Java Console.
Once you have confirmed that your applet works properly with the Sun JRE, you might want to consider the best way of deploying the Sun JRE for your customers. See Internet/Intranet Deployment of the Sun JRE.
When running an applet in a browser using the Sun JRE, you might come across the following potential issues, listed by exceptions and symptoms:
Exception | Resolution |
---|---|
java.lang.ClassFormatError thrown by
ClassLoader. |
|
java.lang.ClassNotFoundException thrown by
ClassLoader. |
|
java.security.AccessControlException thrown in
the execution of
java.beans.Introspector.setBeanInfoSearchPath(). |
|
java.lang.ClassNotFoundException thrown by
ClassLoader on the com.ms.security
package. |
|
java.lang.ClassNotFoundException thrown by
ClassLoader on the com.ms.*
package. |
|
java.lang.ClassCastException thrown from the AWT
Dispatch Event Thread when mouse moves over an applet
frame. |
|
java.lang.NullPointerException thrown from a
thread when Applet.start() or
Applet.stop() is called. |
|
java.lang.NullPointerException thrown in
java.awt.Graphics.drawString() . |
|
java.lang.NullPointerException thrown in
java.awt.Graphics.drawImage() . |
|
java.lang.IllegalArgumentException thrown in
java.awt.Color constructor. |
|
java.security.AccessControlException thrown in
stop() , suspend() , or
resume() method of
java.lang.Thread. |
|
java.lang.InstantiationException: either code or object
should be specified, but not both. |
Symptom | Resolution |
---|---|
Applet running in the Sun JRE is no longer
signed after repackaging the signed .cab files as
.jar files. |
|
Signed applet upgraded from .cab
to .jar file throws a security exception when run in
Microsoft VM. |
|
Unable to use certificates from the browser for client authentication. | |
CJK (Chinese-Japanese-Korean) fonts, when displayed in bold, are difficult to read. | |
Redirection between HTTP and HTTPS URLs is not followed. |
If you run into an issue not covered in the preceeding list, see Java Upgrade Forum.