Installation from Download
Prerequisites
In order to start using Grails you need to have the following:
- An installation of Java SDK 1.4 or higher and have set your JAVA_HOME variable to the SDK install location
Steps
- Download the latest Grails release
- Extract the archive into an appropriate location; typically C:\grails on Windows or ~/grails on Unix
- Create a GRAILS_HOME environment variable that points to the path where you extracted the archive (eg C:\grails on Windows or ~/grails on Unix)
- If you have not set the JAVA_HOME environment variable yet, create JAVA_HOME environment variable that points to the path where you have installed Java
- Append a reference to the "bin" directory within the Grails directory to your PATH variable (eg %GRAILS_HOME%\bin on Windows or $GRAILS_HOME/bin on Unix)
- Type "grails" at the command line, if a help message is displayed you are ready to start using Grails!
- If you get an error message, try to chmod +x the grails script inside the bin directory.
Installation from Subversion
Prerequisites
In order to start using Grails from SVN you need to have the following:
- An installation of Java 1.4 or higher and have set your JAVA_HOME variable to the install location
- A working installation of Apache Ant 1.6.5 or higher
- JUnit (to run the build tests - put junit.jar in your ANT_HOME\lib directory)
- An installation of Subversion
Steps
- Checkout Grails from the SVN repository
- Run this command: svn co http://svn.codehaus.org/grails/trunk/grails/
- Set the GRAILS_HOME environment variable to the checkout location
- Add the "%GRAILS_HOME%\bin" directory to your PATH environment variable
- Add the "%GRAILS_HOME%\ant\bin directory to your PATH environment variable.
- (You may need to give the scripts in "%GRAILS_HOME%\ant\bin execute permissions.)
- Go to the %GRAILS_HOME% directory and type "ant" to build Grails
- That's it! Start developing in Grails!
Comments (6)
Nov 29, 2005
Jeremy Aston says:
If you are on a Unix/OS X platform you will probably need to also set execute pe...If you are on a Unix/OS X platform you will probably need to also set execute permissions on the grails script in $GRAILS_HOME/bin/grails, e.g. chmod a+x $GRAILS_HOME/bin/grails
May 30, 2006
Curtis Cooley says:
If you are on a Unix/OS X platform you will probably need to also set execute pe...If you are on a Unix/OS X platform you will probably need to also set execute permissions on the grails script in $GRAILS_HOME/bin/grails, e.g. chmod a+x $GRAILS_HOME/bin/grails
As well as figure out how to save $GRAILS_HOME/ant/bin/ant with UNIX line feeds instead of DOS. I was getting an error about ant not being able to find interpreter "/bin/sh^M"
I used Kate in KDE to save the file as a UNIX file and so far so good.
Perhaps it's time to create DOS and UNIX distributions?
Jun 14, 2006
Jan Schultze says:
I had the same /bin/sh^M problem. I just wanted to point out that this problem c...I had the same /bin/sh^M problem. I just wanted to point out that this problem can be solved without creating different distros. Just remove the the DOS-style line end, since all Unices will get confused and WIndows users will use the ant.bat - the shell script won't work for them.
Dec 11, 2007
david.huangqi says:
My system is Fedora 8. After downloaded the jdk-6u3-linux-i586-rpm.bin and insta...My system is Fedora 8. After downloaded the jdk-6u3-linux-i586-rpm.bin and installed to the "/usr/java/jdk1.6.0_03", and downloaded the grails-bin-1.0-RC2.zip and unzip to the "/usr/grails/grails-1.0-RC2", I added the $JAVA_HOME="/usr/java/jdk1.6.0_03" and $GRAILS_HOME="/usr/grails/grails-1.0-RC2" then I set the $PATH=$PATH:$GRAILS_HOME/bin.
When I typed grails in the terminal, the result was:
{
Welcome to Grails 1.0-RC2 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /usr/grails/grails-1.0-RC2
No script name specified. Use 'grails help' for more info
}
then I tried the grails help then comes:
{
Welcome ...
Base Directory: /root
Environment set to development
Note: No plugin scripts found
Running script /usr/grails/grails-1.0-RC2/scripts/Help.groovy
[mkdir] Created dir: /root/.grails/tmp
...
}
I think it must be the environment problem, but I used to be a .net programer and had no experience in java developing. Does it mean that I need to install the tomcat or ant or Spring etc and how to do? (Pls forgive my ignorance).
So anybody can help me, thank you in advance!
Dec 20, 2007
charlie kuharski says:
david.huangqi -What is the question? I'm running XP and I get the sam...david.huangqi
-What is the question? I'm running XP and I get the same messages, but I'm able to use Grails. You can ignore them (unless you intended to use scripts).
So please, what is the issue?
Apr 01, 2008
Stephen Lewis says:
Installing on OS-X... I want to install groovy on OS-X (10.5) and am new to Macs...Installing on OS-X...
I want to install groovy on OS-X (10.5) and am new to Macs. Can you provide a more detailed instruction of what needs to be done and how to do it?
Looking forward to using groovy ...
StephenL