from Wikipedia, the free encyclopedia
Groovy logo
Basic data
Paradigms : object-oriented , partly declarative , imperative
Publishing year: 2003
Designer: James Strachan
Developer: The Groovy Project, Apache Software Foundation
Current  version 3.0.5   (July 19, 2020)
Typing : strong , static , dynamic
Influenced by: Python , Ruby , Java
Operating system : platform independent
License : Apache License 2 (Open Source)

Groovy is a programming language and scripting language that supports dynamic and static typing . It is one of the languages ​​that are executed on the Java Virtual Machine , which enables it to be available for many platforms such as Linux , macOS and Windows in particular . The original developer James Strachan's design goal was to combine a “polished” version of Java syntax with the concepts of Ruby .

Groovy has some features that are not available in Java: native syntax for maps , lists and regular expressions , a simple template system with which HTML and SQL code can be generated, an XQuery- like syntax for running object trees, operator overloading and a native representation for BigDecimal and BigInteger.

Unlike other script languages, Groovy is not executed via an interpreted abstract syntax tree , but translated directly into Java bytecode before the script is run . Syntactically, Groovy is much further removed from Java than BeanShell , but much closer to Ruby and Python .

Groovy is used, among other things, in the financial sector due to the easy handling of BigDecimal. Groovy is considered to be better integrated than most of the other scripting languages ​​on the JVM. This enables easy use of existing libraries or the use of Groovy objects and classes in Java.

The project started in 2003. Groovy was included in the Java Community Process for standardization in 2004 as JSR 241 . The JSR, originally founded by James Strachan, is led by Guillaume Laforge, who is also the project manager of the implementation project. Long before Groovy version 1.0, which was released in early 2007, Strachan switched to ActiveMQ. In 2015, Groovy was accepted as an incubator project by the Apache Software Foundation .

For Groovy there are plugins for Eclipse , IntelliJ IDEA , NetBeans , Visual Studio Code , vim and Emacs .


The following compact Groovy script source code that runs in this form

["Rod", "Carlos", "Chris"].each { println it }

corresponds to this abbreviated Java code snippet that lacks the Java method in which the code must be executed:

List.of("Rod", "Carlos", "Chris").forEach(System.out::println)

See also


Web links

Wikibooks: Groovy  - learning and teaching materials

Individual evidence

  1. Release 3.0.5 . July 19, 2020 (accessed July 21, 2020).
  2. From source code to bytecode ( Memento of the original from March 8, 2009 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot /
  3. JSR 241 in the Java Community Process
  4. ^ Groovy Project Incubation Status. The Apache Software Foundation, April 16, 2015, accessed October 26, 2015 .
  5. code-groovy