Use PlatformClassLoader as default instead of boot classloader on java9 - inspired by a patch from Ingo Bauersachs. Thanks. (This closes
@@ -126,6 +126,15 @@ public class BundleWiringImpl implements BundleWiring
{
ClassLoader cl = null;
try
+ {
+ cl = (ClassLoader) BundleRevisionImpl.getSecureAction().invokeDirect(
+ BundleRevisionImpl.getSecureAction().getMethod(ClassLoader.class, "getPlatformClassLoader", null)
+ ,null, null);
+ }
+ catch (Throwable t)
+ {
+ // Not on Java9
+ try
{
Constructor ctor = BundleRevisionImpl.getSecureAction().getDeclaredConstructor(
SecureClassLoader.class, new Class[]{ClassLoader.class});
@@ -141,6 +150,7 @@ public class BundleWiringImpl implements BundleWiring
cl = null;
System.err.println("Problem creating boot delegation class loader: " + ex);
}
+ }
m_defBootClassLoader = cl;
}
