Installation

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). Note that, for Windows, both PATH and GRAILS_HOME must be defined at the same environment variable level (eg. 'System variables') rather than across environment variable levels (eg. PATH under 'System variables' and GRAILS_HOME under 'User variables')
  • 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_HOMElib directory)
  • A Subversion client

Steps

  • Checkout Grails from the SVN repository
  • 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!

Other Languages

14 Comments

  • Gravatar
    the steps mentioned above have been followed but still i get an error

    the syntax of the command is incorrect

    please help me out to solve it

    Mar 24, 2009 01:03 AM diyaMalhotra
  • Gravatar
    can u suggest a good gui support or the best IDE for Grails and Groovy
    Mar 24, 2009 01:03 AM diyaMalhotra
  • Gravatar
    can u suggest a good gui support or the best IDE for Grails and Groovy
    Mar 24, 2009 01:03 AM diyaMalhotra
  • Gravatar
    Most popular commercial IDE is IntelliJ IDEA 8.1. Latest netbeans (6.5 or 6.7M2) is reasonable. Eclipse plugin current seems to be weak, although with the SpringSource announcement it's likely to improve.

    If you don't need an IDE you could try TextMate on a Mac or vi/emacs.

    Mar 25, 2009 22:03 PM PeterBell
  • Gravatar
    Nice! This is the first time in a while that I've seen something truly revolutionary in Java. For too long, it's been more and more 'frameworks', each with their own plethora of XML configuration files, which are more syntax and languages in themselves than just configuration.

    Finally, Java grows up! I want power and productivity, so thanks for making Java relevant again! Now just merge more Rails 2.3 magic into Grails!

    Apr 04, 2009 18:04 PM marlinspike
  • Gravatar
    Hello. The link to the stand alone GORM zip file (gorm-0.5.6.zip) is broken. Have a nice day !
    Apr 07, 2009 14:04 PM hendrik
  • Gravatar
    Try out the latest Netbeans 6.7 beta. It has the best Groovy and Grails support in a free IDE yet.
    May 11, 2009 22:05 PM Xymor
  • Gravatar
    Try to install grails 1.1.1 on Windows set GRAILS_HOME, add bin directory into path. When try to run grails i have error:

    Error starting Grails: org/codehaus/gant/GantBinding java.lang.NoClassDefFoundError: org/codehaus/gant/GantBinding at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.getMethod0(Class.java:2670) at java.lang.Class.getMethod(Class.java:1603) at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(Grail sStarter.java:178) at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStart er.java:212) Caused by: java.lang.ClassNotFoundException: org.codehaus.gant.GantBinding at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) … 6 more

    May 14, 2009 09:05 AM antonevane
  • Gravatar
    A couple of people have encountered that problem :

    sothmann posted on Twitter:

    edit startGrails.bat, replace line 130 with set JAVA_OPTS=%JAVA_OPTS% -Dgrails.version="1.1.1"

    May 14, 2009 10:05 AM Sounie
  • Gravatar
    Thanks.

    I see on 130 line JAVA_OPTS=%JAVA_OPTS% -Dgrails.version="1.1.1-SNAPSHOT"

    I download binary release.

    May 14, 2009 11:05 AM antonevane
  • Gravatar
    As of 8:20 pm EST, the binary download's startGrails.bat has been fixed already, and things are working great.
    May 14, 2009 19:05 PM rstudner
  • Gravatar
    i downloaded the tar.gz archive for windows and the batch file still has the error mentioned above in it
    May 22, 2009 02:05 AM vlahu
  • Gravatar
    Try to install grails 1.1.1 on Windows set GRAILS_HOME, add bin directory into path. When try to run grails i have error: Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/g rails/cli/support/GrailsStarter Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.c ort.GrailsStarter at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    Jun 02, 2009 09:06 AM fmatuszewski
  • Gravatar
    Installing on Windows and getting NullPointer

    C:devgrails-1.1.1>grails create-app Welcome to Grails 1.1.1 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: c:devgrails-1.1.1

    Base Directory: C:devgrails-1.1.1 WARNING: There was an error loading the BuildConfig: null java.lang.NullPointerException at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.createCla ssName(ClassLoaderForClassArtifacts.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePogoMet hod(CallSiteGenerator.java:211) at org.codehaus.groovy.reflection.CachedMethod.createPogoMetaMethodSite( CachedMethod.java:216) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createCachedM ethodSite(PogoMetaMethodSite.java:206) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.createPogoMet aMethodSite(PogoMetaMethodSite.java:182) at groovy.lang.MetaClassImpl.createPogoCallCurrentSite(MetaClassImpl.jav a:3024) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallCurrentS

    C:devgrails-1.1.1>env | grep grails !C:=C:devgrails-1.1.1 GRAILS_HOME=c:devgrails-1.1.1 PATH=/cygdrive/c/Perl/site/bin:/cygdrive/c/Perl/bin:/usr/bin:/cygdrive/c/dev/jav a/j2sdk50/bin:/cygdrive/c/java/C:/Program Files/TeXLive/bin/win32:/cygdrive/c/WI NDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c /Program Files/IBM/Infoprint Select:/cygdrive/c/Notes:/cygdrive/c/Program Files/ XLView:/cygdrive/c/lotus/compnent:/cygdrive/c/Utilities:/cygdrive/c/Program File s/IBM/Personal Communications/:/cygdrive/c/Program Files/IBM/Trace Facility/:/cy gdrive/c/utilities/WinSCP/:/cygdrive/c/Program Files/Intel/Wireless/Bin/:/cygdri ve/c/Program Files/ThinkPad/ConnectUtilities:/cygdrive/c/WINDOWS/Downloaded Prog ram Files:/cygdrive/c/dev/svn-1.5.1/bin:/cygdrive/c/dev/ant170/bin:/cygdrive/c/d ev/maven209/bin:/cygdrive/c/Program Files/MySQL/MySQL Server 5.0/bin:/cygdrive/c /dev/fabric-2.5-replay/fabric-2.5/bin:/cygdrive/c/Program Files/QuickTime/QTSyst em/:/cygdrive/c/dev/wpml/bin:/cygdrive/c/dev/grails-1.1.1/bin

    C:devgrails-1.1.1>

    Jun 10, 2009 13:06 PM dawood

Post a Comment