1. How to Load Serialized Plugins? coderanch.comThat's it: private static ClassLoader createClassLoader(File path){ try{ URL url = path.toURL(); URL[] urls = new URL[]{url}; return new URLClassLoader(urls); } catch (MalformedURLException mfurle){ mfurle.printStackTrace(); } return ClassLoader.getSystemClassLoader(); } public static Object getInstanceOf(String className, File jarFile) { Object instance = null; try{ ClassLoader classLoader = createClassLoader(jarFile); Class c = classLoader.loadClass(className); Constructor[] constructors = c.getConstructors(); instance = constructors[0].newInstance(new Object[]{}); } catch (ClassNotFoundException ... |