The information in this article applies to:
SUMMARYThis article explains how to have the Java Virtual Machine dynamically add a Java package (ZIP file) to the classpath before executing applets on a Web page. This method uses an install cab that is compatible with both Internet Explorer 3.x and Internet Explorer 4.0x. You will need the SDK for Java 2.0 or later available at http://www.microsoft.com/java/. MORE INFORMATION
The typical method in Internet Explorer 3.x for downloading, installing,
and executing a Java applet is to use an install cab. This method is also
compatible with Internet Explorer 4.0x. When installing a Java package in
ZIP format, there are certain registry entries that need to be made to make
the Java Virtual Machine aware that the classpath needs to be altered.
Fortunately, there is a template provided for you with the SDK for Java
that does most of the work for you.
The Java Virtual Machine looks at two registry keys when deciding whether
to run the Java applet in trusted mode or not. Trusted Java code will
execute outside of the Java "sandbox." Code that is trusted is installed in
%windir%\Java\TrustLib. Code that does not require the relaxed restrictions
is installed in %windir%\Java\Lib (which is the default in Master.inf).
The Virtual Machine will trust the installed ZIP file if it is installed in %windir%\Java\TrustLib and the registry key HKEY_CLASSES_ROOT\CLSID\%ClassId%\InProcServer32\TrustLib is equal to %windir%\Java\TrustLib. For Java code that does not need to be trusted, it should be installed in %windir%\Java\Lib, and the registry key HKEY_CLASSES_ROOT\CLSID\%ClassId%\InProcServer32\Lib should be set to %windir%\Java\Lib. Please follow the instructions in Master.inf to make the appropriate changes for your install. Make sure to put the name of your ZIP file in the following section as stated in 1 below:
The above key will dynamically add the "%49000%" (or
"%49000%\<ZipFileName>") directory to the Java Virtual Machine's classpath
when the <OBJECT> tag is read. The "%49000%" variable is defined as the
contents of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java
VM\LibsDirectory that, by default, is defined as %windir%\Java\Lib.
Note that if you are installing the ZIP file in the %windir%\Java\TrustLib directory, make sure to update the following section as stated in the instructions:
By default, the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java
VM\LibsDirectory is equal to %windir%\java\lib, and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM\TrustedLibsDirectory is equal
to %windir%\java\trustlib.
Even though the <OBJECT> tag points to an install cab, the install cab is only installed once, and there after runs from its installed directory (either %windir%\Java\Lib or %windir%\Java\TrustLib). Since the Master.inf file stores either "TrustLib" or "Lib" in the InProcServer32 node in the registry, the Virtual Machine will be able to add the appropriate entries to the classpath to run the Java applet. In SDK for Java 2.0 and later, the package manager DUBUILD can be used, but to be Internet Explorer 3.x compatible, the above method should be used. REFERENCES
The Master.inf file included SDK for Java contains several comments
explaining how to create an install cab. The SDK for Java documentation
also includes information on how to use CABARC, which is used to create CAB
files.
Q168941 INFO: Frequently Asked Questions for CAB FilesFor the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, please see the following pages on the Microsoft Technical Support site: http://support.microsoft.com/support/visualj/ Additional query words: install CAB classpath
Keywords : kbSDKJava300 kbSDKJava310 JVM kbSDKJava320 kbSDKJavaFAQ kbJavaVMFAQ |
Last Reviewed: November 16, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |