Tuesday 30 November 2010

Installing Grails on Linux

Before installing or using Grails, set JAVA_HOME environment variable:

1. Add the following to  ~/.profile

export JAVA_HOME=/usr/local/jdk1.6.0_27/
export PATH=$PATH:/usr/local/jdk1.6.0_27/bin

Location will be where JDK is installed to.

2. Log out and back in again, run echo $JAVA_HOME and echo $PATH to confirm. Also check by typing java -version.

To install Grails:

1. Download grails from http://www.grails.org/Download
2. Extract the archive into a home directory. Typically /usr/local in Linux
3. Append a reference to grails as a variable, as with JAVA_HOME above

export GRAILS_HOME=/usr/local/grails-1.3.7/
export PATH=$PATH:/usr/local/grails-1.3.7/bin


Location path will be the directory you saved the extracted files to.

4. Log out and back in again.
5. Type grails in a terminal window to test. You should see:


Welcome to Grails 1.3.5 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /home/lee/grails-1.3.5

No script name specified. Use 'grails help' for more info or 'grails interactive' to enter interactive mode


You can now begin writing grails applications

1 comment:

  1. Thanks Lee! That was easy. :>)

    By the way, if you don't want to logout and back in again to test the changes you made to your .profile, simply open a terminal window (you should land in your home directory) and type source .profile

    That terminal window will now recognize the new environment variable settings, and the changes will also be there the next time you login.

    ReplyDelete