Sun Java Solaris Communities My SDN Account Join SDN
 
FAQ

Java Plug-in: FAQ

 
 

Frequently Asked Questions
about APPLET tag support in Java Plug-in

See also the FAQ for end-users and consumers on the Get Java web site.

Why should I encourage people to use the Java 2 Platform?

The Java 2 Platform is richer than its predecessors in functionality, performance, and security options. As a developer, you want the users of your software to have the most feature-complete Java platform possible so that the full range of APIs and libraries are available for your applications. If your customers are using the Java 2 Platform, you can write more powerful, robust, and full-featured applications and applets. And, with the Java 2 Platform, the performance of your code will be better too.

By using the latest Java Plug-in with APPLET tag support, you can help to ensure that clients running your applets will have the latest Java 2 Platform.

Can I continue to use OBJECT tags to call my applets?

Yes. Even though the Java Plug-in has been enhanced to support APPLET tags, it is fully backward compatible with an existing web pages that use OBJECT tags to launch applets. Moreover, the JRE/Java Plug-in continues to ship with the HTML Converter for those developers who want to invoke their applets using OBJECT rather than APPLET tags.

I have been using <object> for previous version of Java Plug-in. In this release, <applet> is also supported. I am very confused - which one should I use?

Java Plug-in supports both <applet> and <object> for Internet Explorer.

If you are trying to target Internet users, usually you have less control over the users' environment. Also, bandwidth can be an important consideration. Thus, we recommend that <applet> be used for mass deployment purposes.

If you are targeting Intranet users, usually you have a more controlled environment. In this case, we recommend that <object> be used for fine versioning control.

Are there compatibility issues with using the Java 2 Platform?

In the large majority of cases, there are no compatibility issues to be concerned about when moving from JDK 1.1 to the Java 2 Platform. The documentation for a given Java 2 Platform release describes all known incompatibilities, most of which are in the category of "corner cases." For example, known compatibility issues in version 1.3 of the Java 2 Platform are described at http://java.sun.com/j2se/1.3/compatibility.html.

Some old class files generated by early bytecode compilers do not strictly conform to the proper class-file format, and the Java 2 Runtime Environment may not load such classes. For more information, see Updating Old Class Files.

In addition to compatibility issues between different releases of the Java platform, there is the question of incompatibilities between Sun's Java runtime environment and other Java runtime environments, for example the one included with some Internet Explorer browsers. Sun has made a great effort to minimize such incompatibilities. Among the steps that Sun as taken in this JRE/Java Plug-in are the following:

  • The classloader sharing policy in Java Plug-in has been changed to minimize incompatible behavior in applets that depend explicitly on the classloader sharing policy of the Microsoft VM. See Class Loader Issues for information about ensuring this change doesn't affect your applets' behavior.
  • The image and sound resource lookup sequence in Java Plug-in has been changed to give resources specified with the HTML archive paramater priority over those on the codebase URL. This change was made to minimize incompatible behavior for applets that rely explicitly on the resource lookup sequence employed by the Microsoft VM.
  • The implementation of Applet.getParameter() has been modified to strip off leading and trailing whitespace from parameters before they are returned to the applet. This is the behavior of the Microsoft VM in some Internet Explorer browsers, and this change was made to eliminate possible incompatibile behavior in applets that rely explicitly on that behavior.
  • The sun.audio package was accessible to applets in JDK 1.1. However, the applet sandbox was closed up beginning with version 1.2 of the Java 2 Platform, so applets that try to access any class libraries in the sun.audio packages would result in a SecurityException. To provide maximum applet compatibility, the applet sandbox in Java Plug-in has been opened up to all applets to access the sun.audio package again.
  • Java Plug-in no longer checks the HTML MAYSCRIPT parameter, used in previous versions to enable applets to access JavaScript. Applets may access JavaScript in all cases, even without the MAYSCRIPT parameter.
  • The HTTP User-Agent string used by Java Plug-in during HTTP connection requests has been changed to be similar to that used by the browser. This means that most web servers will recognize connection requests made from applets running in Java Plug-in.

Q: The file Java Runtime Environment 1.3.1_0x (an ActiveX Control) in the WINNT/Downloaded Program Files directory says it's "Damaged." What does this mean? What can I do about it?

A: This is a cosmetic bug; you won't run into any actual problems with the Java Runtime Environment. It does not mean that anything is damaged or that the installation failed. However, if you would still like to make it read "installed" instead of "damaged", you can edit the windows registry. First double-click on the ActiveX Control that is "damaged" (Java Runtime Environment 1.3.1_0x) and check the ID value. Go to Start->Run, type regedit and hit "Ok". Traverse to the following registry key: HKEY_LOCALE_MACHINE//Software//Microsoft//Code Store
Database//Distribution Units//{ID}//DownloadInformation
, where ID is the value of the ID. Double click on the INF registry string, delete the string contents, and hit "Ok". The status of the previously "damaged" ActiveX control should now say "installed".

What security model does Java Plug-in use?

JRE/Java Plug-in is a product in the Java 2 Platform family, and it uses the new Java 2 Platform's security model. This security model is more flexible and configurable than the security model used by JDK 1.1. For more information,s ee the Java 2 Platform's security documentation at http://java.sun.com/j2se/1.3/docs/guide/security/index.html.

I ran an applet but encountered the following messages in the Java Console: "Netscape security model is no longer supported. Please migrate to the Java 2 security model instead.". What should I do?

You may want to start from here:

http://java.sun.com/j2se/1.3/docs/guide/security/index.html http://java.sun.com/products/plugin/1.3/docs/rsa_signing.html

Note that applets that rely explicitly on proprietary technology in the security model of the Microsoft VM may not work with Java Plug-in.

What registry keys are created by Java Plug-in on Microsoft Windows?

The registry keys created by JRE/Java Plug-in during installation are located at HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment and are summarized in the document at http://java.sun.com/j2se/1.3/runtime_win32.html. JRE/Java Plug-in does not support registry keys created and used by the Microsoft VM located at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM. For example, registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM\Classpath sets the class path for the Microsof VM, but this class path is not recognized by JRE/Java Plug-in. (Nor should you put the Microsoft VM class path on the Java Plug-in class path as doing so risks breaking applets or producing unexpected behavior in applet function.)

Will Java Plug-in overwrite my installed Microsoft VM?

No. Although Java Plug-in will take over the <applet> support in Internet Explorer, Java Plug-in does not overwrite any Microsoft VM binaries. In addition, Java Plug-in only overrides the Microsoft VM when <applet> is used, so other applications which rely on the Microsoft VM explicitly will continue to work.

Can I install JRE 1.3.1_01a when I already have JRE 1.3.1_01 installed?

The installer for 1.3.1_01a will allow you to do this, but JRE 1.3.1_01a will be installed in the same directory as JRE 1.3.1_01, and that can lead to improper operation or crashes. Therefore, you should uninstall previous installations of 1.3.1 software prior to installing JRE 1.3.1_01a or Java 2 SDK 1.3.1_01a.

After I completed the auto download process, I got the message "Can,t run 16-bit Windows program". What's wrong?

This may cause by some unsuccessful download of the bits. You may want to retry the download process from http://java.sun.com/getjava, or download the binary manually from http://java.sun.com/j2se/1.3.1/jre/.

I want to deploy Java Plug-in on multiple machines but don't want to repeat the auto install process. What should I do?

You may want to download the binary manually from http://java.sun.com/j2se/1.3.1/jre/.

How can I switch between Java Plug-in and the Microsoft VM for handling the <applet> tags?

Under Advanced tab in Internet Explorer's control panel, you may toggle the option through "Use Java 2". The change will be in effect after you restart the browser.

How can I easily setup <applet> support for all the clients within the enterprise?

Java Plug-in/JRE provides silent install support for this purpose. In this release, <applet> support for Internet Explorer and Netscape 6 is not enabled by default in silent install mode. To silent install <applet> support, please use the following flag:
-iexplorer (for Internet Explorer)
-netscape6 (for Netscape 6)
Please consult Silent Installation of Java Plug-in for more information.

Is Mozilla supported by this release?

Since Netscape 6 is derived from the Mozilla code base, Java Plug-in should work with Mozilla. However, since Mozilla is still in beta, Sun does not provide offical support for Mozilla at this point.

The JRE/Java Plug-in installer shows install options only for Internet Explorer and Netscape 6. How about Mozilla?

Since Mozilla is still in beta phase, the JRE/Java Plug-in installer does not support Mozilla. To run JRE/Java Plug-in with Mozilla, simply copy NPOJI600.dll into Mozilla's plugins directory.

Since Microsoft is pulling Java support on Windows XP, is this release primary for Windows XP?

No. Java Plug-in supports the <applet> tag in Internet Explorer 4/5/6 on the majority of Win32 platforms.
My screen was corrupted when running Java Plug-in in Internet Explorer 5.5. What's wrong?
There is a known bug in Internet Explorer 5.5 that prevents Java Plug-in to repaint properly. This problem has been fixed in Internet Explorer 5.5 Service Pack 2. Please upgrade your browser accordingly.

I was having stability problem when running the Microsoft VM in Internet Explorer. Installing Java Plug-in for <applet> doesn't seem to solve it. Is this a generic <applet> problem?

No. There are several factors related to stability problems in the browser, and it may not relate to Java Plug-in. Please make sure you have the latest OS and browser's service packs installed. Most of our customers reported their problems go away after installing the latest service packs.

Will all my existing applets run seamlessly in Java Plug-in?

We have put in a lot of effort to ensure most of the applets on the Internet will run flawlessly and seemlessly in Java Plug-in. However, some applets may be written explicitly for the Microsoft VM, or may depend on certain undocumented runtime behavior of the Microsoft VM. Such applets will need to be migrated to Java Plug-in.

Do I need to change anything in the APPLET tag to use Java Plug-in?

No. Once Java Plug-in is installed, you don't need to change anything in the APPLET tag, and most applets should work out of the box as long as they are standard JDK 1.1-compatible applets.

How can I access Java Console?

Java Console is accessible from the Java cup-and-steam icon in the system tray of the taskbar.

What is the different between the "Use Java 2" option in Internet Explorer's control panel and the browser option in Java Plug-in Control Panel?

The "Use Java 2" option will enable/disable the <applet> support of Java Plug-in temporatory, so users may switch to the Microsoft VM if necessary. The browser option in Java Plug-in Control Panel is for completely reinstall/uninstall <applet> support of Java Plug-in on the system.
While my applet works well with the Microsoft VM, it does not show up in Java Plug-in. What's wrong?
Usually, this may be related to unnecessary lock on AWT objects. Because of certain fundamental changes in AWT implementation between JDK 1.1 and Java 2, locking AWT objects while performing certain AWT calls may result in deadlock.

My applet is having problem in Java Plug-in, how can I debug it?

There are several ways:
Java Console
You may monitor tracing messages directly from Java Console. Various options are also provided in Java Console to aid debugging.

Java Debugger
You may debug your applet through IDEs. You simply specify the proper debug VM setting in Java Plug-in Control Panel, start the browser and applet, then attach the debugger with the browser process. Please consult your IDE vendors for more info.

Console
You may specify "-verbose" in Java Plug-in Control Panel. When the applet starts, VM level messages will be output to a DOS console window. You may press Ctrl-Break on the console window anytime to generate a thread dump. This is very useful to debug deadlock problem.

My applet takes a long time to launch because of the download time of the class files. How can I speed that up?

You should bundle your class files in Jar files. Jar files are more compact than class files and will reduce download time. Use the archive parameter of the <applet> tag to specify the names of your applet's Jar files. For information about applet tag parameters, see See the Using the APPLET Tag section of the Java Tutorial for an example.

For general information about <applet> tag parameters, including the archive parameter, see the Java Plug-in HTML Specification.

My applet fails with a ClassFormatError. What's wrong?

This problem may be caused by the fact that bytecode generated by old compilers may not conform to the virtual machine specification, which more strictly enforced by recent releases of the JRE. See Updating Old Class Files.

Why doesn't Java Plug-in load my applet's cab file?

The Java Plug-in supports applet packaging in jar files. It does not support the Microsoft proprietary cab file format. Therefore any applets packaged in Microsoft's cab file format will not load in JRE/Java Plug-in.

Will my Authenticode-signed applet work with Sun's JRE/Java Plug-in?

No. The Sun JRE/Java Plug-in does not support Microsoft proprietary technology such as Authenticode signing and cab file formats. Signed applets that rely on Microsoft's Authenticode technology will not load in JRE/Java Plug-in. Use the Java Plug-in's support for RSA-signed applets instead.

My applet uses J/Direct, AFC, and WFC, etc. Will it work in Sun's JRE/Java Plug-in?

No. Libraries for these and other proprietary Microsoft technologies are not included with JRE/Java Plug-in. Applets that rely on these Microsoft proprietary technologies will not work properly when run on JRE/Java Plug-in.

Why does my applet throw a NullPointerException from the AWT Dispatch Event thread?

The events that occur during applet startup and shutdown may differ between the Microsoft and Sun implementation of the Java platform. For example, the logic in an applet may rely on the applet being visible when Applet.start()/Applet.stop() is called. That condition may be true when the applet is run on Microsoft's implementation, but may not be true on Sun's impelementation.

Applets that rely on specific events that occur during startup and shutdown on Microsoft's implementation of the Java platform may not work properly on JRE/Java Plug-in. The most common symptom of this type of problem is a NullPointerException from the AWT Dispatch Event thread.

Why does my applet throw a ClassCastException from the AWT Dispatch Event thread?

The number of containers between the applet and the encompassing frame are different in the Microsoft and Sun implementations. Therefore, an applet that relies on the frame being at some particular level of containment in the Microsoft VM, without navigating the entire AWT hierarchical component tree, is likely to fail when run on Sun's JRE/Java Plug-in. The most common symptom of this problem is a ClassCastException from the AWT Dispatch Event thread.

Does Java Plug-in support Java-JavaScript communication?

Yes, Java Plug-in supports basic, bidirectional Java-JavaScript communication.

Previously, Java Plug-in required that that HTML parameter MAYSCRIPT be used to invoke applets that needed to access JavaScript. However, the Microsoft implementation does not honor the MAYSCRIPT parameter, and many existing applet pages on the web do not include it in their HTML. To provide maximum compatibility with existing applets, Java Plug-in no longer checks the MAYSCRIPT parameter, allowing all applets to access JavaScript.

The following, however, is a known incompatibility.

In the Microsoft implementation, applet methods and properties exposed in JavaScript are exactly the same as the methods and fields in the applet object. In Java Plug-in, an applet's methods and properties are exposed in JavaScript through JavaBeansTM introspection, which treats the applet's fields in a different manner than the Microsoft VM. Therefore, JavaScript accessing fields in an applet object may not work the same when run on JRE/Java Plug-in. This incompatibility may be addressed in a future release of Java Plug-in.

I downloaded Java Plug-in 1.3.1_01a and my applets communication on different frames are no longer working, while it worked in previous release. What's wrong?

In 1.3.1_01a, applets may communicate to each other through AppletContext only if they are on the same page. If they are in different frames, you may need to use static variable to communicate instead.

When the installer is launched, it complains about insufficient disk spaces on C:. What should I do?

The installer requires 10-20MB free spaces to expand itself in order to complete the installation process. You may want to clean up some of the files in C: before the installation.

I currently have J2SE 1.4 installed which has its own plugin. Thus the 1.3.1_01a doesn't seem to get downloaded and installed. Is this wrong?

No, this is an expected behavior. APPLET tag support is always enabled for the latest greatest version of J2SE. If a newer version is already installed, it will be the default.

Can I use Norton SystemWorks CleanSweep to monitor the installation of Java Plug-in?

We have received several reports of browsers locking up when viewing an applet after allowing Norton SystemWorks CleanSweep to monitor the Java Plug-in installation. If you believe you have encountered this problem, try uninstalling the Java platform, then reinstall it without allowing CleanSweep to monitor the process.

I am trying to use LiveConnect, but I can't find netscape.javascript.* to compile my program.

To use LiveConnect in your program, you need to include jaws.jar in your CLASSPATH when you compile the program.

After installing Java Plug-in, running applets do not work. All I saw is just an empty box in the applet area. How can I fix it?

If you goto the Control Panel, you will find a Java Plug-in Control Panel icon. Double click it will launch the control panel. Click on the "Browser" tab, uncheck "Internet Explorer" and click "Apply". Check "Internet Explorer" again and click "Apply". Now, start your browser again and run applets. This should resolve the problem.

I am running Microsoft Windows with Internet Explorer 6. After installing the Java Plug-in product, applets will not load unless all internet files are empty or computer restarted. What's wrong?

The problem you encountered may be related to using ActiveDesktop on Windows. In this case, you may want to restart the system to ensure the system is clean after the installation.

Does the Java Plug-in product support Netscape 4.78 or 4.79 browsers?

Currently, 4.78 and 4.79 are not fully supported by the Java Plug-in product. If you experience any problem with these browsers, you may want to disable the option from Preference->Advanced->Enable Java Plug-in. This should resolve your problem. The other alternative is to use an older version of the Netscape browser, or use the Netscape 6 browser.

I can't find the browser panel in the Java Plug-in Control Panel as described in the GetJava web site. What's wrong?

The problem you encountered may be caused by installing the incorrect version of the Java Plug-in product on the machine. You may want to uninstall the current version, and install again from http://java.sun.com/getjava/.

How do I change heap size for the VM in the Java Plug-in product?

Currently, Java Plug-in will automatically adjust the max VM heap size when it runs, depends on the machine. However, you may also change the heap size by specifying it in the Java Runtime Parameter in the Java Plug-in Control Panel.

What is the icon in the system tray? Can I get rid of it?

The icon you see in the system tray is actually for the Java Console, and it will appear when the Java Plug-in product is currently running. In the current release, the icon will always show up when the Java Plug-in product is running. However, we will consider providing options to turn it off in future release.

Is there any automatic way to download javax.sound.midi, soundbank.gm along with the Java Plug-in product?

Currently, there is no automatic solution for the problem you mentioned, but we will look into it for a future release.

"SecurityException: class "ident"s signer information does not match signer information of other classes in the....." What's wrong?

The problem is caused by a change in the security model between JDK 1.1 and the Java 2 platform. In the Java 2 platform, classes from the same package are required to be signed from the same signer. Apparently, classes from the same package in your applet are signed from different signer, so the error message was displayed. To fix this issue, you may want to contact the web site and ask them to sign the applet properly.