Sun Java Solaris Communities My SDN Account Join SDN
 
Documentation

Java Plug-in: What's New

 

What's New in Java Plug-in 1.3.1_01a

Japanese
Developer Docs

Contents

Support for the APPLET Tag
Compatibility with the OBJECT Tag
Supported Platforms and Browsers
Class Loader Issues
Updating Old Class Files
Other Enhancements
Fixed Bugs

Support for the APPLET Tag

Java Plug-in now supports the HTML APPLET tag for launching applets on Microsoft Windows platforms. Users may configure their browsers so that JRE 1.3.1_01a is the default runtime environment for handling APPLET tags.

For developers, the Java Plug-in enhancements enable you to deploy your applet web pages without the need for an HTML Converter or the use of OBJECT tags, while still being able to ensure that your users will have the latest JRE/Java Plug-in for running your code. In outline form, the new model for launching an applet is as follows.

  1. User accesses web page which employes APPLET tags (not OBJECT tags) to launch an applet.

  2. The web page invokes a script that determines whether the latest, enhanced JRE/Java Plug-in is installed on the user's machine.

  3. If the latest, enhanced JRE/Java Plug-in is not installed on the user's machine, the script initiates an auto-download process for the JRE/Java Plug-in if the user's machine is a Microsoft Windows platform. For other platforms, the script sends the user to a web page that directs the user to manually download JRE/Java Plug-in.

  4. If the latest JRE/Java Plug-in from Sun is installed on the user's machine, Java Plug-in checks whether the user has selected it as the default runtime environment for running applets. If so, then the applet is launched on Sun's JRE. If not, the browser's internal Java runtime environment (if it has one) will be used to run the applet.

Even though Java Plug-in now supports the APPLET tag, it does not support applets that make use of proprietary technologies. Examples of such technologies are

  • CAB files
  • Authenticode signing
  • Java Moniker

Compatibility with the OBJECT Tag

This release of Java Plug-in supports the use of APPLET tags for launching applets from web pages on Microsoft Windows platforms. However, it is also fully backward compatible with previous Java Plug-in releases in its support of the OBJECT tag for launching applets. Developers have the option of using the 1.3.1_01a HTML Converter to set up their applet web pages to use the OBJECT tag as before.

For more information about using OBJECT tags to launch applets on Java Plug-in, see Java Plug-in HTML Specification and Using the HTML Converter.


Supported Platforms and Browsers

The support for the APPLET tag in JRE/Java Plug-in 1.3.1_01a is intended for use on the following Microsoft Windows operating systems:
  • Windows 95
  • Windows 98 (1st and 2nd editions)
  • Windows ME
  • Windows NT 4.0
  • Windows 2000
In addition, JRE/Java Plug-in 1.3.1_01a has been tested on pre-releases of Windows XP and is expected to work with the final release of Windows XP.

JRE/Java Plug-in 1.3.1_01a provides support for the APPLET tag on the following web browsers:

  • Internet Explorer 4.0 (4.01 recommended), 5.0 (5.01 recommended),
       5.5 (Service Pack 2 recommended), 6.0
  • Netscape 6.0, 6.1

Class Loader Issues

Prior to version 1.3.1_01a, Java Plug-in would use a single class loader to load multiple applets during a browser session. This practice allowed the multiple applets to share information with each other through static variables.

In order to maximize compatibility with the Java virtual machines embedded in Microsoft Internet Explorer browsers, beginning with version 1.3.1_01a Java Plug-in uses separate class loaders for applets that differ in their codebase and/or the value of the ARCHIVE parameter in the APPLET tags that invoke the applets. Only if two or more applets share the same codebase and have the same value for their ARCHIVE parameter will the same class loader be used.

Applets that rely explicitly on the old Java Plug-in behavior with respect to class loaders may be incompatible with the new Java Plug-in. That is, applets that rely on the ability to share information afforded by a single class loader may fail to work properly if the new Java Plug-in uses separate class loaders for each applet. If this compatibility issue applies to your applets, you can force Java Plug-in to use a single class loader for multiple applets by simply ensuring that all applets have the same codebase and that the APPLET tags used to launch the applets each has the same value for the ARCHIVE parameter.


Updating Old Class Files

In some cases, the new Java Runtime Environment associated with this Java Plug-in release will not run class files that were generated with old compilers. The usual symptom is a java.lang.ClassFormatError that the virtual machine throws when it attempts to load such a class file. This failure has nothing specifically to do with the changes in this release. Rather, old bytecode compilers did not strictly adhere to proper class-file format in all situations when generating class files. Recent virtual machines are implemented to be strict in enforcing proper class file format, and this can lead to errors when they attempt to load old, improperly formatted class files. Some typical problems in some older class files are (this list is not exhaustive):
  • There are extra bytes at the end of the class file;
  • The class file contains method or field names that do not begin with a letter;
  • The class attempts to access private members of another class;
  • The class file has other format errors, including illegal constant pool indices and illegal UTF-8 strings;
  • Some early (third-party) bytecode obfuscators produced class files that violated proper class-file format.

You can avoid this type of problem by recompiling your classes with the Javac bytecode compiler from the current Java 2 SDK. If you choose to use a third-party obfuscator, be sure to use one that produces class files that respect proper class-file format.


Other Enhancements

In addition to the support for the APPLET tag described above, the Java Plug-in has many performance and architecture enhancements that will make it more suitable for widespread use on consumer client machines that typically are not as powerful as client platforms in an enterprise environment. Some of these enhancements are summarized below.
  • Memory management
    • Dynamic maximum heap size is scaled down from 128 MB to 96MB to avoid unnecessary paging on the system.
    • Classloader implementation has been tuned to allow memory to be reclaimed more often by the garbage collector.
    • Potential memory leak issue is addressed by using JNI/COM smart pointers in implementation.

  • Performance
    • Applet download time is significant reduced by relying on browser caching when possible. No connection will be opened on the server side unless it is absolutely necessary.
    • Applet lifecycle is controlled asynchronously to allow very fast page switch.
    • Sped up classloader object reclaim by removing its finalize() method.
    • HTTPS read has been made significantly faster by increasing buffer size.
    • HTTPS calls are significant faster by statically linking Microsoft's Wininet instead of dynamic function lookup every time.
    • JavaScript performance is greatly enhanced by eliminating BeanInfo lookup over the network.
    • Java Console performance is enhanced by using the Console Writer thread to avoid blocking System.out and System.err when possible.

  • Design
    • Default JavaScript/Java interaction is changed from "not-scriptable" to "scriptable", allowing any applets running through the APPLET tag to be used from JavaScript without modification.

  • JDK 1.1 compatibility
    • Java Plug-in can now access the sun.audio package.
    • Some of applets are compiled with compilers that don't generate proper class file format which conforms the class-file specification. Such appletss may result in a ClassFormatError when Java Plug-in attempts to load them. To help address this problem, PluginClassLoader provides a bytecode scanner to transform bad class files to conforming on-the-fly to allow the applets to run. Currently, only the bad class filse with the following errors may be transformed
      • Local variable name has bad constant pool index
      • Extra bytes at the end of the class file
      • Code segment has wrong length
      • Illegal Field/Method name
      • Illegal field/method modifiers
      • Invalid start_pc/length in local var table

      See also Updating Old Class Files above.

Fixed Bugs

For a list of bugs fixed in this release of Java Plug-in, see
http://java.sun.com/j2se/1.3.1/ReleaseNotes.html

Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.