|
发表于 2005-6-8 14:04:11
|
显示全部楼层
ClassLoader thisLoader = Thread.currentThread().getContextClassLoader();
URLClassLoader cl = URLClassLoader.newInstance(urls, thisLoader);
Thread.currentThread().setContextClassLoader(cl);
Class cls=cl.loadClass(MAINCLASS);
Class[] ptypes = new Class[] { args.getClass() };
Method main =cls.getDeclaredMethod("main", ptypes);
main.invoke(null,new Object[]{args}); |
|