//***** Remote class loading import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; public class SimpleClassLoader { public static void main(String[ ] args) { try { // Hard code the URL to test. // Directories must end with '/' String url = "http://condor.depaul.edu/dmumaugh/JDP/test/"; // Create an array of URLS to search. URL[ ] urls = { new URL(url) }; // Construct a loader to search the URLs. URLClassLoader ucl = new URLClassLoader(urls); // Load the class and instantiate it. Class class_A = ucl.loadClass("A"); Object object_A = class_A.newInstance(); System.out.println("Class name: " + class_A); System.out.println("Object: " + object_A); } catch(MalformedURLException e) { System.err.println(e); } catch(ClassNotFoundException e) { System.err.println(e); } catch(IllegalAccessException e) { System.err.println(e); } catch(InstantiationException e) { System.err.println(e); } } }