Groovy is the new "Ruby" like language that runs on top of the Java VM, it is the backbone of the Grails initiative which aims to provide a Rails like environment on the Java Platform, Groovy is to Grails, as Ruby is to Rails.
This post will show you how to setup groovy on Leopard, and allow you to explore this intriguing new language.
First make sure you have java and its dev tools setup on your machine see this post on how to do that.
Now download groovy from the groovy site.
Unpack the archive and move it to /usr/share , for example:
$ sudo mv ~/downloads/groovy-1.5.4 /usr/share
Now set ownership and permissions on the directories
$cd /usr/shareNow create a symlink to access the current version of groovy by, if you download and install another version later, you can just move the symlink to point at it, this is a good practice as it prevents you having to overwrite your old installation.
$sudo chown -R root:wheel groovy-1.5.4/
$sudo chmod 0755 groovy-1.5.4/bin/*
$sudo ln -s groovy-1.5.4 groovyFinaly add the following to your /etc/profile or ~/.profile depending on wether you want it available for all logons or just your own.
GROOVY_HOME=/usr/share/groovy; export GROOVY_HOME
And the following to your path in the same file, note your path should be defined after the above
PATH=$GROOVY_HOME/bin:$PATH; export PATH
Now your ready to try it out and see if it works, open up a terminal and type:
The groovy console window should open up as shown above, thats it your done, stay tuned for more groovy news.