Setup JDK in Ubuntu
Steps:
1.Extract jdk to opt folder

command: sudo unzip jdk1.*.zip -d '/opt'

2.Edit your .bashrc file

command: gedit ~/.bashrc

3.Add the following lines at the end of .bashrc

export JAVA_HOME=/opt/jdk1.*
PATH=.:$PATH:$JAVA_HOME/bin
export PATH

4.Reload .bashrc and test version

command:source ~/.bashrc

command: java -version


Setup Groovy in Ubuntu

Grails comes with it’s own bundled groovy version so this can be skipped.
Steps:
1.Extract groovy binary to opt folder

command: sudo unzip groovy-binary-*.zip -d '/opt'

2.Edit your .bashrc file

command: gedit ~/.bashrc

3.Add the following lines at the end of .bashrc

export GRAILS_HOME=/opt/grails
PATH=.:$PATH:$JAVA_HOME/bin:$GROOVY_HOME/bin:
export PATH

4.Reload .bashrc and test version

command:source ~/.bashrc
command: groovy -version

Setup Grails in Ubuntu
Steps:
1.Extract groovy binary to opt folder

command: sudo unzip grails-*.zip -d '/opt'

2.Create a Link to grails directory name grails

command: sudo ln -s grails-2.0.3 grails

2.Edit your .bashrc file

command: gedit ~/.bashrc

3.Add the following lines at the end of .bashrc

export GRAILS_HOME=/opt/grails
PATH=.:$PATH:$JAVA_HOME/bin:$GROOVY_HOME/bin:$GRAILS_HOME/bin:
export PATH

4.Reload .bashrc and test version

command:source ~/.bashrc
command: grails -version