Adding files to java classpath at runtime [duplicate]
You can only add folders or jar files to a class loader. So if you have a single class file, you need to put it into the appropriate folder structure first. Here is a rather ugly hack that adds to the SystemClassLoader at runtime: import java.io.IOException; import java.io.File; import java.net.URLClassLoader; import java.net.URL; import java.lang.reflect.Method; public … Read more