There are plenty of scripting languages available at the moment on the JVM. Some of them only offer expression language support for data binding and configuration needs, for example, MVEL (http://mvel.codehaus.org/) and SpEL (Spring Expression Language, http://www.springsource.org/documentation). Others provide a fully featured programming language. Examples of these are JRuby, Jython, Clojure, Jaskell, and of course, Groovy.
In this recipe, we will show you how to benefit from Groovy scripting from within your Java application.
To embed Groovy scripts into your Java code base, first of all, you need to add
groovy-all-2.x.x.jar library to your class path. Or if you are using Java 7 and want to take advantage ...