Grails Guide

Tutorials And Examples on Grails

Groovy Tutorial - Setup Your Windows Environment

When learning a new technology, the first hurdle is to setup your workstation to begin coding. This tutorial will walk through the steps for preparing your Windows box for Groovy development. It will also show you how to create your first "Hello World" Groovy program at the end.


The steps below will assume that Groovy/Grails Tool Suite will be installed. It is an IDE based on Eclipse and ready to run Groovy and Grails application out of the box.

Install Java Development Kit

Groovy/Grails Tool Suite needs Java to be installed to your system. It is recommended to use the latest Java Development Kit (JDK) released from the Oracle website. For this tutorial, JDK 1.7 will be used. The installer is available here (
Set the JAVA_HOME environment variable to where you installed the downloaded JDK. It is always a good practice to set this variable on any Java development box.

Install Groovy/Grails Tool Suite (GGTS)

You can start Groovy development by just using notepad. But I highly recommend the GGTS IDE for convenience in working with Groovy (E.g. syntax highlight). In addition, this IDE is ready if you wish to explore the Grails web framework later.
Go to the website and download your preferred release (
And extract the zip to your drive:
You can then run the IDE application.
Next we need to tell GGTS to use the newly installed JDK 7. Go to Window » Preferences
Click Add and then Choose Standard VM. Click Next.
Select the folder where JDK 7 was installed and click Finish.
Make it the default JRE by selecting it and click then OK.

Hello World Goovy Program

If this is your first time with an Eclipse based IDE like GGTS, this is how to create a simple Hello World Groovy Program.
First is to create a new Groovy Project. Go to File » New » Other
Select Groovy Project and then click Next
Give it a name and click Finish
A blank Groovy project will be created. To create a new Groovy class, right click on src and select New » Other.
Select Groovy Class and then select Next
Give a name for the class and click Finish.

Use this code for the class:

package hello
class Hello {
	static main(args) {
		println "Hello World"

To run this, right click on the class and select Run As » Groovy Script.
Ant the output will be displayed at the Console Window.