Some sun.misc internal APIs are deprectaed in JDK 9 and will be encapsulated or removed in a future release.
static URLClassPath getBootstrapClassPath() { return sun.misc.Launcher.getBootstrapClassPath(); } }
ClassLoader oscl = sun.misc.Launcher.getLauncher().getClassLoader(); Field scl = ClassLoader.class.getDeclaredField("scl"); scl.setAccessible(true); scl.set(null, oscl); //reflect my real main method here, dont actually call the code because the system classloader will preload it.
static URLClassPath getBootstrapClassPath() { return sun.misc.Launcher.getBootstrapClassPath(); } }
public static ClazzLoader createBootstrapClassLoader() { URLClassPath cp = Launcher.getBootstrapClassPath(); return new UrlClazzLoader(BOOTSTRAP_CLASS_LOADER, "N/A", cp.getURLs()); } }
public static ClazzLoader createBootstrapClassLoader() { URLClassPath cp = Launcher.getBootstrapClassPath(); return new UrlClazzLoader(BOOTSTRAP_CLASS_LOADER, "N/A", cp.getURLs()); } }