--- old/src/java.base/share/native/libjli/java.c 2018-06-20 19:31:15.000000000 +0100 +++ new/src/java.base/share/native/libjli/java.c 2018-06-20 19:31:15.000000000 +0100 @@ -441,14 +441,6 @@ LEAVE(); } - // validate modules on the module path, then exit - if (validateModules) { - jboolean okay = ValidateModules(env); - CHECK_EXCEPTION_LEAVE(1); - if (!okay) ret = 1; - LEAVE(); - } - if (printVersion || showVersion) { PrintJavaVersion(env, showVersion); CHECK_EXCEPTION_LEAVE(0); @@ -457,6 +449,11 @@ } } + // modules have been validated at startup so exit + if (validateModules) { + LEAVE(); + } + /* If the user specified neither a class name nor a JAR file */ if (printXUsage || printUsage || what == 0 || mode == LM_UNKNOWN) { PrintUsage(env, printXUsage); @@ -1955,20 +1952,6 @@ (*env)->CallStaticVoidMethod(env, cls, describeModuleID, joptString); } -/** - * Validate modules - */ -static jboolean -ValidateModules(JNIEnv *env) -{ - jmethodID validateModulesID; - jclass cls = GetLauncherHelperClass(env); - NULL_CHECK_RETURN_VALUE(cls, JNI_FALSE); - validateModulesID = (*env)->GetStaticMethodID(env, cls, "validateModules", "()Z"); - NULL_CHECK_RETURN_VALUE(cls, JNI_FALSE); - return (*env)->CallStaticBooleanMethod(env, cls, validateModulesID); -} - /* * Prints default usage or the Xusage message, see sun.launcher.LauncherHelper.java */