I have a small program where the user can enter a snippet of “real” java code in a text area, and then execute the code in order to perform some simple system tests. This program was made ages ago, and now I am curious if there are some new fancy ways to utilize the java platform in order to achieve the same thing (by for instance having the user entering Groovy in the text area, or perhaps supporting several script languages).
I got curious when I read about java 7 having support for dynamically typed scripts in its virtual machine.
I have a small program where the user can enter a snippet of real
Share
You can use JavaScript support built-in from Java 6: Creating meta language with Java, see also
ScriptEngineFactory.Also Spring framework has a Dynamic language support.
Note that the JVM 7 dynamic language support (via
invokedynamic) is irrelevant here. It is primarily targeted to dynamic languages compiled to JVM bytecode (like JRuby or Groovy).