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.
Asked
Active
Viewed 30 times
0
-
@Dave The link provided by you refers to parsing String in C/C++ languages. – NEO Nov 24 '13 at 15:07
-
It's not clear what you're asking. Are you trying to use remote class loading (downloading a jar from a Web server or similar and then using it in a running program)? – chrylis -cautiouslyoptimistic- Nov 24 '13 at 15:09
-
Look at this question: http://stackoverflow.com/questions/14247716/remote-jars-in-the-classpath – Dave Nov 24 '13 at 15:11
-
@chrylis I want to load classes from the jar located on remote machine. – NEO Nov 24 '13 at 15:16
-
@Dave the link helps in answering my question thanks :) – NEO Nov 24 '13 at 15:20
1 Answers
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