Run piece of code contained in a String

As has already been suggested you can compile, save and run code on the fly using the Compiler API.

Another neat alternative would be to use beanshell. Beanshell is no longer actively developed, but I can vouch for it’s reliability, I’ve used it successfully in multiple production projects.

Leave a Comment