8191170: Clarify if java.class.path can be undefined

Reviewed-by: alanb, psandoz
This commit is contained in:
Mandy Chung 2018-01-25 13:40:36 -08:00
parent f7a44a7d8a
commit 6de0123fd7
2 changed files with 11 additions and 9 deletions

View file

@ -1876,14 +1876,15 @@ public abstract class ClassLoader {
* value until the system is fully initialized.
*
* <p> The name of the built-in system class loader is {@code "app"}.
* The class path used by the built-in system class loader is determined
* by the system property "{@code java.class.path}" during early
* initialization of the VM. If the system property is not defined,
* or its value is an empty string, then there is no class path
* when the initial module is a module on the application module path,
* i.e. <em>a named module</em>. If the initial module is not on
* the application module path then the class path defaults to
* the current working directory.
* The system property "{@code java.class.path}" is read during early
* initialization of the VM to determine the class path.
* An empty value of "{@code java.class.path}" property is interpreted
* differently depending on whether the initial module (the module
* containing the main class) is named or unnamed:
* If named, the built-in system class loader will have no class path and
* will search for classes and resources using the application module path;
* otherwise, if unnamed, it will set the class path to the current
* working directory.
*
* @return The system {@code ClassLoader}
*

View file

@ -631,7 +631,8 @@ public final class System {
* <tr><th scope="row"><code>java.class.version</code></th>
* <td>Java class format version number</td></tr>
* <tr><th scope="row"><code>java.class.path</code></th>
* <td>Java class path</td></tr>
* <td>Java class path (refer to
* {@link ClassLoader#getSystemClassLoader()} for details)</td></tr>
* <tr><th scope="row"><code>java.library.path</code></th>
* <td>List of paths to search when loading libraries</td></tr>
* <tr><th scope="row"><code>java.io.tmpdir</code></th>