Java Upgrade Guide:
|
This guide explains why and how to upgrade applets from the Microsoft Virtual
Machine (VM) for Java to the Sun JRE. In 98% of cases, applets run unchanged
under the Sun JRE. For the remaining 2%, this document points to migration tips.
The results of upgrading should be richly rewarding, 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 1.4.2. Released in 2003,
it includes many enhancements over the early version.
The Microsoft VM, based upon Java 1.1 technology that is over five years old, is clearly outmoded. On the other hand Sun Microsystem's VM, which is part of Sun's 1.4.2 Java Runtime Environment (JRE), is thoroughly standards compliant and up to date. That makes one good reason for upgrading Java applets and applications to run on the Sun JRE. But there are other compelling reasons: millions of copies of the Sun JRE have already been downloaded and deployed, and millions of new computers will soon be shipping with the Sun JRE. The time is ripe for upgrading.
Another reason to upgrade is that after September, 2004, Microsoft will no longer support or provide a Java implementation with any of its products. Microsoft has already discontinued shipping Java technology in its Internet Explorer web browser with the latest versions of its operating systems. This has two important implications:
Note that while Microsoft makes a case for migrating Java applets and applications to J# or C#, neither of these solutions offers cross-platform capability. J# and C# run only on the Microsoft Windows platform.
Here are the steps for upgrading to the Sun JRE:
Although most applets run correctly in the Sun JRE, testing is always a good idea. If you should detect an issue, the solution is at hand. Once you have upgraded your applets, they will be able to run on a robust, secure, cross-platform, standards-compliant version of the Java platform.
Once you have confirmed that your applet works properly with the Sun JRE, you may want to consider the best way of deploying the Sun JRE for users. See Internet/Intranet Deployment of the Sun JRE.
If you don't already have the Sun JRE installed on your test computer, click below to get it.
Before you test your applet, you need to make sure that your browser is running the Sun JRE.
To do so, first open the Windows Control Panel (Start > Settings > Control Panel), then double-click the coffee-cup icon labeled Java Plug-in to launch the Java Plug-in Control Panel. When it appears, select the Browser tab. It looks like this:
Make sure that the check box for the browser you are using is checked.
Next, verify that your browser is running the Sun JRE. If it is, when you run the applet you should:
Java Icon in System Tray:
Java Logo in Gray Box:
Note: If you have Show Java Console selected in the Java Plug-in Control Panel (Basic tab), then the Java Console displays and shows a Java version number, as shown in the next section. The version number indicates which Sun JRE is being used by your browser.
Test your applet by running it. If you have a set of standard tests for it, run it through those tests.
If there is a compatibility issue, you will see details about it in the Java Console. The Java Console looks like this:
For details about the Java Console, see http://java.sun.com/j2se/1.4.2/docs/technotes/guides/plugin/developer_guide/console.html
Here are some potential issues, listed by symptoms, that you might encounter:
ClassFormatError
is thrown by the ClassLoader
. The same applet runs under the
Microsoft VM.ClassNotFoundException
is thrown by the ClassLoader
. The same applet runs under Microsoft
VM..cab
files as .jar
files,
an applet running in the Sun JRE is treated as unsigned. The same applet packaged
as .cab
files runs as signed in the Microsoft VM..cab
to .jar
to
run in the Sun JRE, the applet no longer works in the Microsoft VM. The applet
runs fine in the Sun JRE.AccessControlException
is thrown in the execution of Introspector.setBeanInfoSearchPath()
.The same applet runs under the Microsoft VM.ClassNotFoundException
is thrown by the ClassLoader
on the com.ms.security
package. The same applet runs under the Microsoft VM.ClassNotFoundException
is thrown by the ClassLoader
on the com.ms.*
package.
The same applet runs under the Microsoft VM.java.awt.Component
.
The same applet runs under the Microsoft VM.ClassCastException
is thrown from the AWT Dispatch Event Thread when mouse moves over the applet
frame. The same applet runs under the Microsoft VM.NullPointerException
is thrown from a thread when Applet.start()
or Applet.stop()
is called. The same applet runs under the Microsoft VM.NullPointerException
is thrown in java.awt.Graphics.drawString()
. The same applet
runs under the Microsoft VM.NullPointerException
is thrown in java.awt.Graphics.drawImage()
. The same applet runs
under the Microsoft VM.IllegalArgumentException
is thrown in java.awt.Color
constructor. The same applet runs
under the Microsoft VM.AccessControlException
is thrown in stop()
, suspend()
, or resume()
of java.lang.Thread.
The same applet runs under the Microsoft
VM.InstantiationException
is thrown. The same applet runs under the Microsoft VM.If you run into an issue not covered in the preceeding list, please see the Java Upgrade Forum: