Sunday, March 10, 2002 05:53 PM
Setting classpath at runtime doesn't work because it has already been used to create the App ClassLoader. The easiest thing to do is turn the current classpath into an array of URLs, add a URL for the new path to the end of the array, and create a new URLClassLoader with the URL array you just set up. Now you can use the new ClassLoader to load classes from the newly extended classpath. Make sure to link the new ClassLoader into the existing ClassLoader chain.