By wikipedia,
Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, Perl, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings.
Our Jenkins files are writen in Groovy.
In terminal
//find out java version
/usr/libexec/java_home -V
//export java path
export JAVA_HOME=`/usr/libexec/java_home -V`
//check java version
java -version
//install groovy
brew install groovy