Java: Load class from string

后端 未结 4 2134
粉色の甜心
粉色の甜心 2020-12-18 16:09

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

4条回答
  •  渐次进展
    2020-12-18 16:39

    You can use Rhino and JavaScript in JDK 7. That might be a good way to do it.

    invokedynamic is coming....

    If you want to stick with Java, you need something to parse the source and turn it into byte code - something like cglib.

提交回复
热议问题