Installing Groovy and Grails on OSX

Download the latest versions of Groovy & Grails. Currently that is and Let’s unzip these archives into /usr/share;

cd /usr/share
sudo unzip ~/Downloads/
sudo unzip ~/Downloads/

Next we setup environments variables, which points to these paths. Adding these to our .bash_profile, makes our system environment read it.

cat << EOF >> ~/.bash_profile
# Java, Groovy & Grails
export GROOVY_HOME="/usr/share/groovy-2.0.1"
export GRAILS_HOME="/usr/share/grails-2.1.0"
export JAVA_HOME="/Library/Java/Home"
export PATH="\$PATH:\$GROOVY_HOME/bin:\$GRAILS_HOME/bin:\$JAVA_HOME/bin"

Open a terminal a type grails -version to verify.