final String jdkHomePath = CompilerConfigurationImpl.getTestsExternalCompilerHome();
if (jdkHomePath == null) {
throw new IllegalArgumentException("[TEST-MODE] Cannot determine home directory for JDK to use javac from");
}
// when running under Mock JDK use VM executable from the JDK on which the tests run
return new MockJdkWrapper(jdkHomePath, jdk);
}
return jdk;
}