I know this has probably something to do with class loaders, however I couldn\'t find an example (it might be I\'m google-ing for the wrong keywords.
I am trying to
You could compile it using JavaCompiler but I suggest you to use Groovy for this run-time class creation. It would be much easier.
JavaCompiler
Groovy