Does this actually work with classes that are not in the lib folder?
I think in general you need to pass the user code class loader (Thread.currentThread().getContextClassLoader()).