Loading Classes with the Classpath Setting

Class loading involves the process of changing the classpath setting to locate a DLL containing a required class. The specifiers in the classpath setting are processed in order until the DLL is found. Class loading is aggressive. When a class residing in a DLL is loaded, all references from that class and all other classes in the DLL will be fully resolved before the initial load is completed.

Understanding the Processing of a Classpath Specifier
For a moment, let's make the following assumptions:

  1. Assume that C is a specifier for a directory; for instance, C=/u/hpj. If a search needs to be conducted for the required class java.lang.Error, the following processing occurs:

    1. The file /u/hpj/java/lang/Error.jlc is examined to see if it contains the required class.
    2. The file /u/hpj/java.jll is examined to see if it contains the required class.
    3. The file /u/hpj/java/lang.jll is examined to see if it contains the required class.

  2. Assume that C is a .jll specifier; for example, C=/u/hpj/classes.jll. In this instance, the file classes.jll is examined to see if it contains the required class.

  3. Assume that C is an actual ZIP file, for example, C=/u/hpj/classes.jar, or the filename extension is .zip. In these instances, C is logically replaced by one or both of the following specifiers:

    The .jll extension is added if the ZIP file has no extension on its filename. In this example, the file /u/hpj/classes.jll is examined first to see if it contains the required class. If /u/hpj/classes.jll does not contain the class, the /u/hpj/classes directory is searched using the directory search rules previously described.

    The intent of splitting ZIP file specifiers into two logical specifiers is to provide a flexible mechanism so that the ZIP file can be compiled into one or more DLLs. This allows it to be appropriately placed so that the classpath setting does not need to change.

 


Java Executables and DLLs
Environment Variables


Changing Environment Settings