How the VM Searches for Classes
When a class is requested, the Microsoft VM normally searches for it in the following order.
- Check all explicitly specified locations (typically supplied with the jview /cp option; not applicable for applets).
- Check the locations specified in the HKLM\Software\Microsoft\Java VM\DevClasspath registry entry.
Note This registry entry is provided for development and testing and may not be supported in a future release. Microsoft does not recommend relying on it for production purposes.
- Search packages in the Java Package Manager (JPM) marked as system packages (see the following notes).
- Check the locations specified in the HKLM\Software\Microsoft\Java VM\TrustedClasspath registry entry.
- Check the directory specified by the HKLM\Software\Microsoft\Java VM\TrustedLibsDirectory registry entry.
- Check the locations specified in the HKLM\Software\Microsoft\Java VM\Classpath registry entry.
- Check the directory specified by the HKLM\Software\Microsoft\Java VM\LibsDirectory registry entry.
- Check the locations specified in the CLASSPATH environment variable.
- Search packages in the JPM marked as non-system packages (see the following notes). Search first for non-system classes in the specified namespace, then search for non-system classes in no namespace (global namespace).
- If served from a Web page, the Microsoft VM additionally searches the following locations:
- Any cabinet files referenced by the cabinets applet parameter (in the order in which they appear in the HTML file). If there is a cabinets applet parameter, the cabbase parameter and the Archive attribute (following) will not be searched.
- The cabinet file referenced by the cabbase applet parameter. If there is a cabbase applet parameter, the Archive attribute (following) will not be searched.
- Any .zip or .jar file referenced by the Archive attribute of the <APPLET> tag.
- Search the code base of the HTML file.
Notes
- The contents of the registry values for steps 2, 4, and 6 and the environment variable in step 8 should contain a semicolon-delimited list of directories and .zip files, .jar files or both. Multiple entries will be searched in the order they appear. The registry values for steps 5 and 7 may specify only a single directory.
- Classes loaded by steps 1-8 are considered system classes. Classes loaded by steps 9-11 are considered non-system classes. Non-system classes are not loaded by the system class loader, but instead are loaded by an instance of a Java ClassLoader. Non-system classes are not global and will not interact with other non-system classes loaded by a different ClassLoader. All the standard packages installed with the Microsoft VM are system packages.
- When a class is loaded by an untrusted caller from one of the specified locations and it is only safe for use by a trusted caller, an exception may occur when trying to call a method or access a member of the class.
A package installed into the JPM must meet the following requirements to be considered a system package:
- Must reside in the global namespace.
- Must be signed with full permissions.
- The .osd file inside the installation cabinet must specify the <SYSTEM/> tag for each package. If using the dubuild tool to create the cabinet file, use the /S command-line option to specify system packages.
© 1999 Microsoft Corporation. All rights reserved. Terms of use.