Java Plug-in Usage Notes

M. Gallant 02/26/2002

Subject: Java Plug-in version usage notes
Date: Mon, 25 Feb 2002 10:29:03 -0500
From: Michel Gallant 
Organization: Bell Sympatico
Newsgroups: comp.lang.java.programmer, comp.lang.java.security


There seems to be ongoing confusion on configuring Java Plug-in to specify
a specific version of the Plugin-in, and how to specify a *minimum* level of the
plugin. Based on extensive trial and error  :-p  I assemble some observations here
that I will publish shortly at  http://home.istar.ca/~neutron/java.html.
Any comments/corrections are welcome.

The "Multi-Version Support" chapter of the "Java Plug-in 1.4 
Developer Guide" contains important information.
The information below pertains mainly to the Win32 platform.
[Note: htmlConverter 1.4 contains checkboxes in the "Java Versioning for Applets" section which enables a default (dynamic) version, or a particular version. The Help menu item for htmlConverter 1.4 describes how it works.]

---------------- Internet Explorer ------------------------

For *dynamic* version support of Plugin-in for Internet Explorer, you specify the fixed classid specifier: <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" .... This classid value (8AD...) will registry-map to the current (latest?) version installed on the client. Therefore, if the client has Plugin 1.3.1_02, that version will be invoked by the html. If the client has Plugin 1.4.0, that version will be used. If you wish to FORCE a SPECIFIC version of Plugin to be used on the client (which will raise a download dialog if the version is not present), then use the *static* version classid specifier which has a *unique* ID for each version; e.g. for Plugin 1.3.0_02: <OBJECT classid="clsid:CAFEEFAC-0013-0001-0002-ABCDEFFEDCBA" ... (the Multi-Version Support chapter above describes this in sufficient detail). htmlConverter Note: The default configuration for the htmlConverter is to use the *static* classid specifier, forcing the end user to retrieve exactly that Plugin version! This is true for htmlConverter 1.3.1_02 and 1.4.0-rc. Developers can manually change the classid form static to dynamic in the html source code as required by their taret audience. <p>

------------- Netscape Communicator ---------------

The particular version of Java Plugin-in used by Netscape Communicator depends on the MIME type attribute in the Netscape-specific EMBED tag. htmlConverter versions 1.3.1_02 and 1.4.0-rc both use the "jpi-version" form: e.g., to specify Plugin 1.3.0_02, this tag is generated: <EMBED type="application/x-java-applet;jpi-version=1.3.1_02" .... which forces the end user to use *exactly* this version. However in many cases, users will have an earlier version of 1.3 and the developer may not wish to burden the user with the latest Plugin download. Using the older style of version attribute seems to work (although this is not well documented): <EMBED type="application/x-java-applet;version=1.3" ... which evidently will use any sub-version of Plugin 1.3+. [Using "jpi-version=1.3" will use exactly version 1.3.0] ---------- Using multiple versions of Plugin simultaneously ----------- It appears that only ONE version of Java Plug-in can be instantiated during a give browser session (either Netscape 4.76 + or IE5+). If one tries to load in multiple plug-in version pages in sequence on a platform that has the necessary versions, various error messages appear. The browser must be shut down and restarted to load alternate versions (at least Plugin 1.3 and Plugin 1.4). However, it *is* possible to have one browser (say Netscape) have a Plugin 1.3-enabled page running simultaneusly while Internet Explorer is running a Plugin 1.4-enabled page. This is very handy for Plugin-version comparisons (e.g. Swing has some GUI differences between j2se 1.3 and 1.4). ----------- Using multiple versions of htmlConverter ----------------- Both j2sdk v1.3.1_02 and j2sdk v1.4.0-rc come with htmlConverter. To use them effectively, I use two different launcher batch files, which ensures that the correct version of java is used (again, Win32 platform): -- Version 1.3.1--- cd C:\jdk1.3.1\lib \jdk1.3.1\jre\bin\java -jar htmlconverter.jar -gui --- Version 1.4.0-re -- cd C:\j2sdk1.4.0-rc\lib \j2sdk1.4.0-rc\jre\bin\java -jar htmlconverter.jar -gui