我研究了甲骨文文档方面的URL API。我想要构造URI来引用位于远程计算机上的Jars,但是,从规范中我无法理解如何使用它们。该文档为规范提供了参考RFC2396。但是,这也不能为它的使用提供任何具体的例子。
发布于 2015-05-31 08:30:54
下面的代码对于jar加载很有用
Method method = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class});
method.setAccessible(true);
method.invoke(ClassLoader.getSystemClassLoader(), new Object[]{new URL("http://somewhere.net/library.jar")});
Class.forName("your.remote.ClassName");https://stackoverflow.com/questions/20175916
复制相似问题