Before you start
Learn what to expect from this tutorial and how to get the most out of it.
Groovy is a lot like Java 2.0, if someone set out to completely rewrite the Java language today. Rather than replacing Java, Groovy complements it, providing a simpler, slicker syntax where the type checking is done dynamically at runtime. You can use Groovy to write Java applications on the fly, to glue together Java modules, or even to extend existing Java applications — you can even use Groovy to unit test your Java code. And the beauty of it is, Groovy lets you do all these things faster — sometimes a lot faster — than you would if you were writing pure Java code.
In this tutorial, you'll get to know Groovy, a dynamic language that sits as comfortably on the Java platform as does the Java language itself.
This tutorial guides you step-by-step through the fundamental concepts of Groovy. You will learn about Groovy collections, Groovy classes, and, of course, the Groovy syntax. When you are done with this one-hour tutorial, you will understand the benefits of using Groovy with Java (and vice versa), and you'll be set to start using Groovy in your everyday Java development.
To get the most from this tutorial, you should be familiar with Java syntax and the basic concepts of object-oriented development on the Java platform.
To follow along and try out the code for this tutorial, you need a working installation of either
In addition, this tutorial assumes you are using the Eclipse IDE. You do not need to have Groovy installed as the tutorial walks you through the Groovy Eclipse plug-in installation.
The recommended system configuration for this tutorial is as follows:
- A system supporting either the Sun JDK 1.5.0_09 (or later) or the IBM JDK 1.5.0 SR3 with at least 500 MB of main memory
- At least 20 MB of disk space to install the software components and examples covered
The instructions and examples in the tutorial are based on a Microsoft Windows operating system. All the tools covered in the tutorial also work on Linux and Unix systems.