If Java-like syntax is desired (although I can't imagine why it would be), BeanShell would be the way to go.