--- old/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java 2016-10-26 14:59:25.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java 2016-10-26 14:59:24.000000000 -0700 @@ -69,16 +69,17 @@ bcp = toURLClassPath(s); // we have a class path if -cp is specified or -m is not specified. - // If neither is specified then default to -cp . + // If neither is specified then default to -cp + // If -cp is not specified and -m is specified, the value of + // java.class.path is an empty string if defined, then no class path. URLClassPath ucp = null; String mainMid = System.getProperty("jdk.module.main"); String cp = System.getProperty("java.class.path"); - if (mainMid == null && cp == null) + if (cp == null) cp = ""; - if (cp != null) + if (mainMid == null || cp.length() > 0) ucp = toURLClassPath(cp); - // create the class loaders BOOT_LOADER = new BootClassLoader(bcp); PLATFORM_LOADER = new PlatformClassLoader(BOOT_LOADER);