forked from I2P_Developers/i2p.i2p
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user