
If you want to program using Groovy and Grails,it’s easy to set up in Ubuntu 10.04. And as IDE,I use NetBeans 6.8,which is the most complete IDE there is. Since both NetBeans and Groovy depends on Java,so we install this first. I like to install these things from the terminal,but you can also add them using the Ubuntu Software Center or Synaptic Package Manager. (I also use aptitude instead of apt-get,I will explain why in another post.)
1. As the first step is to enter the Java JDK.
sudo aptitude install sun-java6-jdk
2. Install NetBeans 6.8
sudo aptitude install NetBeans
3. Set up the JAVA_HOME variable
Go to this link where I explain how this is done
4. Install Groovy
sudo aptitude install groovy
Check the version that was installed
groovy -v
Most likely it is version 1.6.4 that was installed. Currently it is version 1.7 which is the latest stable version. We will use 1.6.4 now,and I will get back to how we can get Ubuntu to download a newer version automatically in a separate post.
5. Download the Grail
From this Link
Get the latest TAR/GZ version of Grail,it is currently version 1.1.2. Unpack this and put it in the folder /usr/share/ and rename the folder from grail-1.1.2 to grail
6. Now we set the $GROOVY_HOME variable
go back to step 3 and put it in the same file as for JAVA_HOME
# # # Groovy
GROOVY_HOME = /usr/share/groovy
PATH = $ PATH:$ GROOVY_HOME/bin
export PATH GROOVY_HOME# # # Grail
GRAILS_HOME = /usr/share/Grail
PATH = $ PATH:GRAILS_HOME/bin
export PATH GRAILS_HOME
Restart Ubuntu 10.04
write Grail in the terminal and see if it comes up version number,if it does then the installation was successful.
7. Start up NetBeans
If you have not yet added Groovy in NetBeans then go to Tools –Plugins and Available Plugins. Add then select the Groovy and Grails plugin,and select Install.
The first time you are trying to create a new Grail Application,you must point to the Grail Home. Press the Configure button Grail. Insert /usr/share/grail in the Grail home line,and press OK
Press Finnish,and NetBeans will set up everything you need to start a Groovy on Rails project.
8. Last test to check that it works,press F6 when you are in the NetBeans (Run Main Project),after a few seconds,the browser opens a page where it says welcome to Grails.
Congratulations it works. (I Hope)
So now it’s just getting started on a project,good luck.




I’m transitioning from .NET to Groovy. It’s a whole new world. Thank you for your post. It help me get my baring as to how get started! Thank you. If you have a twitter account let me know.
Hi,
thanks for this post,im new on grails too,but i found a problem following your tutorial.
# # # Groovy
GROOVY_HOME = /usr/share/groovy
PATH = $ PATH:$ GROOVY_HOME/bin
export PATH GROOVY_HOME
# # # Grail
GRAILS_HOME = /usr/share/Grail
PATH = $ PATH:GRAILS_HOME/bin
export PATH GRAILS_HOME
i’m on ubuntu 10.04 too,but the correct way,on las line in each block is:
export GROOVY_HOME PATH
export GRAILS_HOME PATH
thnx
Hi,I have posted an article in Bahasa Malaysia based on your article
http://rajaiskandarshah.blogspot.com/2011/03/belajar-bahasa-baru-groovy-dan-grails.html