ClassLoader (ClassLoader parent) { String loader = SystemProperties.getProperty("java.system.class.loader", null); if (loader == null) { return parent; } try { Constructor c = Class.forName(loader, false, parent) .getConstructor(new Class[] { ClassLoader.class }); return (ClassLoader)c.newInstance(new Object[] { parent }); } catch (Exception e) { System.err.println("Requested system classloader " + loader + " failed."); throw (Error) new Error("Requested system classloader " + loader + " failed.") .initCause(e); } }