Installing GRAILS on Ubuntu 9.10 Karmic Koala



Recently configured GRAILS to run on a laptop running Ubuntu 9.10 so I could play with projects from work (Windows 7 PC) while on the move. All of the installation instructions were either too vague (lacking exact directory locations), outdated (links broken), and/or generally not applicable to a standard setup. I had to piece together the steps which I have put here for you to enjoy.





Step 0. First and foremost install Sun Java JDK 6. Open up the terminal and enter:

sudo apt-get update
sudo apt-get install sun-java6-jdk


Step 1. Now enter this to check:

java -version


If a message appears it was successfully installed


Step 2. Now you need to modify the environment path variables for Java. In terminal enter:

sudo gedit /etc/environment


Append thess lines to the environment file:

LANG="en_US.UTF-8"
JAVA_HOME=/usr/lib/jvm/java-6-sun


You need to be careful when editing your file because there is the potential you could lock yourself out of your system and not be able to log back in. Just type/paste CAREFULLY!

Step 3. Now close GEDIT. GRAILS TIME! You need to download the GRAILS archive file from here.

Step 4. Now create the GRAILS directory on your Ubuntu system and go to it by entering these lines in terminal:

sudo mkdir /usr/lib/grails
cd /usr/lib/grails/


Step 5. Now you need to move the .zip file to your new directory so you can extract it. Enter these in terminal (where xxxxx is the location of the grails-1.3.6.zip file you downloaded e.g. /home/xusernamex/Downloads)

sudo mv xxxxx/grails-1.3.6.zip .
sudo unzip -d grails-1.3.6.zip /usr/lib/grails/


Step 6. Now confirm that you have extracted the .zip to /usr/lib/grails/grails-1.3.6 by entering

cd grails-1.3.6


If your directory changes, you are in like flint.

Step 7. Now just reopen your environment path file to set your GRAILS_HOME variable:

sudo gedit /etc/environment


and append these lines of code to the ones you already entered so your environment file should read like this: (PATH variable is all one line)

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/grails/grails-1.3.6/bin"
LANG="en_US.UTF-8"
JAVA_HOME=/usr/lib/jvm/java-6-sun
GRAILS_HOME=/usr/lib/grails/grails-1.3.6


Ensure everything is right and close GEDIT.

Step 8. Logoff of Ubuntu and log back in so your environment variables can be reread.

Step 9. Now open terminal and enter


grails


You should see version information. And with that your quest is at an end... or is it just beginning?! Enjoy the GRAILS!!! RUN AWAY!

No comments:

Post a Comment