Camaro'
2010-12-14 18:28:45
I am trying to load a jar file and run a method, i made a test jar on my server and the link is in the code. Can someone explain to me why I am getting the classNotFound exception even though I have checked the name like a 100 times? :p
URL s = new URL("http://www.aarondawg.comxa.com/eminer/test.jar!");
URL[] us = { s };
URLClassLoader child = new URLClassLoader (us);
Class classToLoad = Class.forName ("theClass", true, child);
Method method = classToLoad.getDeclaredMethod ("method4");
Object instance = classToLoad.newInstance ();
Object result = method.invoke (instance);
System.out.println(result.toString());