Access a JAR outside the CLASSPATH (this howto is deprecated)Tag(s): DEPRECATED
About cookies on this site
We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
import java.net.*;
import java.io.*;
public class ExtraLoader {
public static void main(String[] args) {
try {
URL urlA =
new File("C:/xtras/xercesImpl.jar").toURL();
URL urlB =
new File("C:/xtras/xmlParserAPIs.jar").toURL();
URL[] urls = { urlA,urlB };
URLClassLoader ulc = new URLClassLoader(urls);
//
Class c = Class.forName
("org.apache.xerces.dom.ChildNode", true, ulc);
//
System.out.println(c.getName());
}
catch(Exception e) {
e.printStackTrace();
}
}
}