|   |  JavaTM Upgrade Guide: Upgrading  | 
This guide explains why and how to upgrade applets from the Microsoft
Virtual Machine (VM) for JavaTM technology to the Sun Java Runtime Environment (JRETM). 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 the following url: http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/console.html
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.ClassFormatErrorthrown byClassLoader. | |
| java.lang.ClassNotFoundExceptionthrown byClassLoader. | |
| java.security.AccessControlExceptionthrown in the execution ofjava.beans.Introspector.setBeanInfoSearchPath(). | |
| java.lang.ClassNotFoundExceptionthrown byClassLoaderon thecom.ms.securitypackage. | |
| java.lang.ClassNotFoundExceptionthrown byClassLoaderon thecom.ms.*package. | |
| java.lang.ClassCastExceptionthrown from the AWT Dispatch Event Thread when mouse moves over an
 applet frame. | |
| java.lang.NullPointerExceptionthrown from a thread whenApplet.start()orApplet.stop()is called. | |
| java.lang.NullPointerExceptionthrown injava.awt.Graphics.drawString(). | |
| java.lang.NullPointerExceptionthrown injava.awt.Graphics.drawImage(). | |
| java.lang.IllegalArgumentExceptionthrown injava.awt.Colorconstructor. | |
| java.security.AccessControlExceptionthrown instop(),suspend(), orresume()method
 ofjava.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 .cabfiles as.jarfiles. | |
| Signed applet upgraded from .cabto.jarfile 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.