Make LaunchedURLClassLoader Java 6 compatible again

Closes gh-7334
pull/7394/head
Andy Wilkinson 8 years ago
parent aafb308eaf
commit 808185ab4e

@ -27,6 +27,7 @@ import java.util.Enumeration;
import java.util.jar.JarFile;
import org.springframework.boot.loader.jar.Handler;
import org.springframework.lang.UsesJava7;
/**
* {@link ClassLoader} used by the {@link Launcher}.
@ -38,7 +39,7 @@ import org.springframework.boot.loader.jar.Handler;
public class LaunchedURLClassLoader extends URLClassLoader {
static {
ClassLoader.registerAsParallelCapable();
performParallelCapableRegistration();
}
/**
@ -186,4 +187,14 @@ public class LaunchedURLClassLoader extends URLClassLoader {
}
}
@UsesJava7
private static void performParallelCapableRegistration() {
try {
ClassLoader.registerAsParallelCapable();
}
catch (NoSuchMethodError ex) {
// Running on Java 6. Continue.
}
}
}

Loading…
Cancel
Save