0

I went through URL API on Oracle documentation. I want to construct URI to refer Jars located on remote machine but, from the specs I am not able to make out how to use them. The document gives reference to RFC2396 for specs. but, that too doesn't provide any concrete examples for its usage.

k4sia
  • 414
  • 1
  • 6
  • 18
NEO
  • 161
  • 1
  • 3
  • 10

1 Answers1

0

Following code is useful for jar loading

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");
NEO
  • 161
  • 1
  • 3
  • 10