# HG changeset patch # User mchung # Date 1516916436 28800 # Node ID a47ee8b3d3083bfbc6a5de94ec97a36c0ac4b94b # Parent ea6706103cefeafb92f1a9e73ccf252ba41e96f1 8191170: Clarify if java.class.path can be undefined Reviewed-by: alanb, psandoz diff -r ea6706103cef -r a47ee8b3d308 src/java.base/share/classes/java/lang/ClassLoader.java --- a/src/java.base/share/classes/java/lang/ClassLoader.java Thu Jan 25 13:39:28 2018 -0800 +++ b/src/java.base/share/classes/java/lang/ClassLoader.java Thu Jan 25 13:40:36 2018 -0800 @@ -1876,14 +1876,15 @@ * value until the system is fully initialized. * *
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. a named module. 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} * diff -r ea6706103cef -r a47ee8b3d308 src/java.base/share/classes/java/lang/System.java --- a/src/java.base/share/classes/java/lang/System.java Thu Jan 25 13:39:28 2018 -0800 +++ b/src/java.base/share/classes/java/lang/System.java Thu Jan 25 13:40:36 2018 -0800 @@ -631,7 +631,8 @@ *
java.class.version
java.class.path
java.library.path
java.io.tmpdir