Console: Java 9 fixes for classloader (ticket #1870)

May not be sufficient for plugins
Unlinkify viewmtn links on /jars, site is down
This commit is contained in:
zzz
2016-10-29 16:21:02 +00:00
parent 484a3903ca
commit 6ff9483e07
5 changed files with 66 additions and 28 deletions

View File

@@ -434,8 +434,12 @@ public class PluginStarter implements Runnable {
if (f.getName().endsWith(".jar")) {
try {
addPath(f.toURI().toURL());
log.error("INFO: Adding translation plugin to classpath: " + f);
log.info("INFO: Adding translation plugin to classpath: " + f);
added = true;
} catch (ClassCastException e) {
log.logAlways(Log.WARN, "Java version: " + System.getProperty("java.version") +
" does not support adding classpath element: " + f +
" for plugin " + appName);
} catch (RuntimeException e) {
log.error("Plugin " + appName + " bad classpath element: " + f, e);
}
@@ -987,6 +991,8 @@ public class PluginStarter implements Runnable {
/**
* http://jimlife.wordpress.com/2007/12/19/java-adding-new-classpath-at-runtime/
*
* @throws ClassCastException in Java 9
*/
private static void addPath(URL u) throws Exception {
URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();