i have'nt tried this myself. But probably you can.. System properties has a property java.lang.path or something like that. Am not sure about the key but you can list them out and check that. try appending the new classpath there and then try accessing your class. Properties prop = Syste.getProperties(); Enumeration e = prop.getPropertyNames(); ... prop.setProperty("java.lang.path","new classpath"); try this and let us know :-) karthik.
The correct name is "java.class.path" but it wouldn't work. I tried the following :
My Test2.class file is placed in D:/TempDir. It seems that the property does change but JVM is not aware of the change. Anyway considering my problem, I've made a custom ClassLoader but I still have to load lots of class files so that I can invoke the main method of my application... Tom.
She still doesn't approve of my superhero lifestyle. Or this shameless plug: