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 can use Rhino and JavaScript in JDK 7. That might be a good way to do it.
invokedynamic is coming....
invokedynamic
If you want to stick with Java, you need something to parse the source and turn it into byte code - something like cglib.