Installing a Grails Development Environment on Windows

Updated for Grails 2.2.x
In this Grails Example, we will set up our development environment on a Windows system.

This first video shows you how to install Grails and Java on Windows. To install Grails, you will need a Java Developers Kit (, and the Grails libraries ( This video will show you how to download and install both. It then shows how to set the appropriate environment variables to allow you to run Grails commands from the command prompt.

Subscribe to Grails Academy Magazine.

In the second video, you learn how to install an Integrated Development Environment (IDE) based on Eclipse called the Groovy & Grails Tool Suite. This tool is pre-configured for Groovy and Grails to give you features such as syntax highlighting and code completion. The video shows you how to install it and configure it for the Grails 2.2.x environment that you installed in the previous video.

Grails Academy Magazine

Grails Academy Magazine now available.

91 thoughts on “Installing a Grails Development Environment on Windows

  1. Just did a new fresh install (Windows 8 Pro) with Grails 2.3.6 on top of Eclipse Kepler.
    I do not know if it matters, but I get this error message when creating and deploying the test app as instructed in the video:

    |Loading Grails 2.3.6
    |Configuring classpathFeb 20, 2014 11:35:56 AM java.util.prefs.WindowsPreferences
    WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0×80000002. Windows RegCreateKeyEx(…) returned error code 5.

    and the process to build a deploy continues:
    |Environment set to development
    |Packaging Grails application
    |Running Grails application
    |Server running. Browse to http://localhost:8080/test

    And I can launch in the browser as I did with the CLI demo app.
    What does this erro mean? Any input is welcome :) Right now I do not know what will go wrong, just nervous to see such error msg from an empty app.

    Cheers, Vincent

  2. Hi I’m new to Grails. I followed your tutorials but I got this error when I try to create-app demo.
    Loading grails
    Configuring classpath
    Environment set to development
    Created grails application at C:\grails\demo
    –im using grails 2.3.5/OS vista 32bit/jdk-7u51

    • Hi Zysert:

      It looks like everything worked as it should. Now just change directories into demo and type grails run-app.


      • All right thanks Mike.
        I also tried to run an app using ggts but got this error.
        |Loading Grails 2.3.5
        |Configuring classpath
        |Environment set to development
        |Packaging Grails application
        |Running Grails application
        Error |
        Server failed to start for port 8080: Address already in use: JVM_Bind (Use –stacktrace to see the full trace)

        • It looks like you already have the application running, perhaps in a command prompt. If you shut down all of your Java processes, or restart your machine, it will probably work fine. If you do have an actual conflict on that port, check out the video on setting up the TimeTracker application and I show you how to change the port that your application runs on. Let me know if that solves the issue.

          • Restarting the PC helps. Thanks a lot, I’m gonna watch more of your video tutorials to know more about grails. :)

        • If you followed the video step by step, you probably still have the demo app that you have created and started from the cmd line. Give it a CTRL-C, terminate batch job = Y, then it should go back to the cmd line prompt and you should be able to run test again and click on the link in Eclipse and see your app up and running.
          Thx, V

        • If you followed the video step by step, you probably still have hte demo app that you have created and started from the cmd line. Give it a CTRL-C, terminate batch job = Y, then it should go back to the cmd line prompt and you should be able to run test again and click on the link in Eclipse and see your app up and running

  3. Hi,
    Thanks for the gr8 video tutorials .I am quite new to grails. I have an issue though running grails from command prompt. Grails project works perfectly fine from eclipse . From command prompt, grails run-app works fine, but grails run-app gives errors. The error is below.

    |Loading Grails 2.3.5
    |Configuring classpath
    |Environment set to development
    |Packaging Grails application
    FATAL ERROR: ‘org.apache.xml.serializer.utils.WrappedRuntimeException: org.apache.xml.serializer.ToXMLSAXHandler incompatible with org.apache.xml.serializer.SerializationHandler’
    :org.apache.xml.serializer.ToXMLSAXHandler incompatible with org.apache.xml.serializer.SerializationHandler
    Error |
    org.xml.sax.SAXParseException: Premature end of file.
    Error |
    at _Events.fixWebXml(_Events.groovy:21)
    Error |
    at _Events$_run_closure1.doCall(_Events.groovy:11)
    Error |
    at _GrailsPackage_groovy$_run_closure5.doCall(_GrailsPackage_groovy:74)
    Error |
    at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:58)
    Error |
    at RunApp$_run_closure1.doCall(RunApp.groovy:28)
    |Running Grails application
    |Server running. Browse to http://localhost:9090/myapp

    Any help would be appreciated. Googling dint help much to solve the issue

    • Are you using the Java package from There are some threads that say the IBM package causes this error. Otherwise, check your path and make sure it points to the bin directory of your JDK and not the JRE directory.

      • Sorry for the late reply.. It was a very stupid mistake actually. I had changed the path and Java home in my system environment variables but i had a JAVA_HOME in my user envt variables which was using webspheres JDK and overridding the JAVA_HOME i set in system envt vars.. thanks a lot for the help:-)

  4. I followed the tutorial , with
    C:\Documents and Settings\patron.luca>java -version
    java version “1.7.0_45″
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
    Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)
    C:\Documents and Settings\patron.luca>grails -version
    Grails version: 2.3.4
    but got this:
    | Script ‘Create’ not found, did you mean:
    1) CreateApp_
    2) CreatePom
    3) CreateScript
    4) CreateFilters
    5) CreateUnitTest
    > Please make a selection or enter Q to quit: 1
    | Created Grails Application at D:\Luca\Grails\demo

    D:\Luca\Grails>cd demo

    | Configuring classpath
    | Error Resolve error obtaining dependencies: Failed to read artifact descriptor
    for xalan:serializer:jar:2.7.1 (Use –stacktrace to see the full trace)
    | Error Required Grails build dependencies were not found. This is normally due
    to internet connectivity issues (such as a misconfigured proxy) or missing repos
    itories in grails-app/conf/BuildConfig.groovy. Please verify your configuration
    to continue.

    | Configuring classpath
    | Error Resolve error obtaining dependencies: Failed to read artifact descriptor
    for xalan:serializer:jar:2.7.1 (Use –stacktrace to see the full trace)
    | Error Required Grails build dependencies were not found. This is normally due
    to internet connectivity issues (such as a misconfigured proxy) or missing repos
    itories in grails-app/conf/BuildConfig.groovy. Please verify your configuration
    to continue.
    any help would be greatly appreciated!

  5. When I created my demo app from the first tutorial and when I created my test app from the second tutorial I got the same message.

    *** java.lang.instrument ASSERTION FAILED ***: “!errorOutstanding” with message transform method call failed at ../../../src/share/instrument/JPLISAgent.c line: 844
    Exception in thread “main”
    Error |
    Forked Grails VM exited with error

    can anyone help with this, please?

  6. Previously,thanks a lot for your video.I’d like to know why there are two errors occurred on my computer ,saying that resolve error obtaining dependencies :could not transfer artifact org.grails,according the steps.Could anyone help me?

    • I also get similar 2 errors, but the app seems to run fine. Would be nice to know what those errors mean though, and how to fix them. Regardless, this is a *** GREAT VIDEO *** Thank you Mike!!

    • What error messages are you seeing. When you execute “grails -version” and “java -version” do you get the correct response?

  7. i must say that the video tutorial is very good but when i run-app demo, it is not downloading from c:/ directory and gives error like “Resolve error obtaining dependencies”:………. i don’t know whether it will work properly or not

  8. Hi, I watched your video and done step by step like you did. everything is working except the last thing. when I create a new project (test) I can’t run it. it says:

    Grails requires JDK. Try to run Grails commands with only a JRE may fail with cryptic error messages, or no error messages at all. The default JMV configured in your workspace appears to be JRE.

    Please ensure that the JDK is configured as the default JMV in your workspace.

    Thank you for your reply.

    • Hi Susan:
      It sounds like your JAVA_HOME environment variable may be set incorrectly. In your computer’s environment variables, what do you have it set to? Mine is set to C:\Program Files\Java\jdk.1.7.0_30. Your location and version may be different, but make sure you set it to the jdk directory and not the jre directory.

  9. I kept getting ‘grails’ is not a recognized internal or external command, and found that what resolved it, was to declare the Environmental Variables in the User section, not the System section.

    • The difference between user and system is that the user variables only execute for your logged in user. The key is to ensure that you close and reopen your command prompt after setting the variables.

  10. Thanks a lot for this tutorial.
    I can run the app from both cmd and IDE, but I get the message in red that seems warning or something. Here is the message:
    Running Grails applicationJun 14, 2013 6:08:43 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    Jun 14, 2013 6:08:43 PM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Tomcat
    Jun 14, 2013 6:08:43 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
    Jun 14, 2013 6:08:44 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
    INFO: No global web.xml found
    Jun 14, 2013 6:08:44 PM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext

    | Server running. Browse to http://localhost:8080/ProjectTracker

    • I get those too on Grails 2.2.2. They appear to just be information messages that the different components of the architecture have started.

  11. Hi,

    I’m getting the following while creating the sample ‘test’ application as per the above groovy/grails tool suite installation video. Can you please help me in resolvingt this issue. FYI, I’m installing it on a ’64bit Windows 7 Professional Sergice Pack 1′ platform.
    Loading Grails 2.2.2
    | Configuring classpath
    | Error Failed to resolve dependencies (Set log level to ‘warn’ in BuildConfig.groovy for more information):
    - org.eclipse.jdt.core.compiler:ecj:3.7.2


  12. Great stuff! I would recommend a couple of minor additions that tripped me up on the installation phase:

    * How to set up a proxy, especially on Windows. This can be a HUGE pain if you don’t know exactly how to do it.

    * How to shut down the app once it’s started with run-app. I still just press Ctrl+C and don’t even know if that’s really the best way :/

    Thanks again for providing this great resource for free!

  13. Hi,
    I downloaded grails 2.2.0 on win 7, 64 bit machine, extracted to C:\grails-2.2.0\grails-2.2.0, in the cmd prompt on entering java -version, got the result as
    java version “″
    Java SE………
    Java Hotspot 64 bit……….

    but for grails -version got error as
    Error: JAVA_HOME is set to an invalid directory: C:\Program files \Java\jdk1.6.0_24
    Please set………

    Again I tried with grails 2.1.1 and got the same error

    Can you pls help….

    • It sounds like you upgraded Java at some point and your JAVA_HOME and PATH variables need to be reset. Check out the part in the video about setting these variables on Windows and see if it helps. Be sure to open a new command prompt after changing the environment variables.

    • Hey,
      It might be late but i faced the same problem. you should try creating a new user variable rather than system variable in Environment variables. And in the user variable create a path with the full path of grails’ bin.

  14. Hi Mkelly
    I downloaded grails-2.2.0 just recently and extracted as per your instructions . now when i try to check from command prompt by Grails -versions i get the message ” the system cannot find the path specified ”
    the valiables setting is OK but i dont know what dose it means.
    i appreciateyou for your help.

  15. Mike, Excellent tutorials. Installed grails 2.1.1 and run-app demo and ‘test’ under
    eclipse 4, it is a wonderful day, thank you very much.

  16. Hello.

    For the first part I have problem to connect with the server localhost. It doesnt shows anything in the web. I have another running localhost called myphpadmin. I dont remember when and where I installed it. How can I remove that one from my localhost then this will work.

  17. Hi Mike,

    I downloaded grails-2.1.1 just recently and extracted as per your instructions on this video. I realised it doesn’t have bin file in the extraction. So when i did grails -version its says “‘grails’ is not recognized as an internal or external command,
    operable program or batch file.”

    Hope u can help.


    • I just downloaded 2.1.1 from and when I unzipped it, there was a bin folder. Perhaps your file did not download correctly or it had problems unzipping.

  18. Pingback: Java Exception when Trying to Run Grails | - Developers Network

  19. Mike – Thanks for your excellent tutorial.

    I used your tutorial in April to install grails 2.0.4 and JDK 1.6.0_29 on my WinXP 32bit machine which worked flawlessly.

    I just downloaded the latest grails (2.1.0) and JDK (1.7.0_17) on my Win7 64bit machine and followed the steps in your tutorial:
    1.) Add environment variables for Java and Grails
    2.) Update path as appropriate
    3.) Verify that everything installed correctly by executing “java -version” and “grails -version”

    The java -version command works, but the grails -version command yields the following error:

    Exception: java.lang.RuntimeException thrown from the UncaughtExceptionHandler in thread “main”

    Any idea is to why this occurred? Thanks.

    • Hi Tom:

      Glad you like the videos. Did you install the 64-bit java jdk on your Win7 machine. What do you get back when you run java -version?


      • Yes, I installed the 64-bit java jdk on the Win7 machine; here’s what I got back when I ran java -version:

        java version “1.7.0_07″
        Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
        Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

        I had earlier versions of Java on my machine, so I made sure to remove them via the “Add / Remove Programs” utility. The Java 1.7 installation also included Java FX 2.1.1; would this program negatively impact the grails install?

        Thanks for your quick response.

        • Java FX would not cause the problem. I found that if I removed %JAVA_HOME%/bin from my path, java -version and grails -version still worked. So that means Grails is finding the Java libraries by some means other than the path. My guess is there is something left over from your previous install that Grails is trying to point to. Unfortunately, my expertise ends there. There are some great folks over at and on the Grails FaceBook page that could probably answer this.

  20. Hi mkelly,

    Thanks for posting this useful videos, it really help me a lot, since i’m not familiar with any of these environment.

    I already install java, copy grails, set the environment path. but when I try to call grails from command line it shows

    ‘grails’ is not recognized as an internal or external command, operable program or batch file.

    is there any step that I miss?
    my OS is windows 7 home edition sp1

    • Hi Nel:
      Glad you are liking the videos so far. The error you are getting is that the command line cannot find where Grails is installed. There is a subtle difference between the GRAILS_HOME setting that points to the Grails directory, and the PATH setting that points to the bin directory inside of GRAILS_HOME. To make sure everything is set correctly, open up a command prompt and type ‘path’ followed by pressing enter. Make sure there is an entry for Grails and that it points to the bin directory where the grails files are. Remember that if you copied the Grails folder inside of a directory called grails like I do in the video, the path should be C:\grails\grails-2.1.0\bin. Also make sure there is a semicolon between the grails entry and the one before it. If you can’t get it working, paste your path below so I can take a look.

  21. Really good tutorial for the windows installation. Grails is running now!
    Thank you so very much. This videos could be part of the fist steps section of Grailswebsite.

    • Thank you. They were nice enough to add them to the installation documentation at I will be updating them for 2.1.0 soon.

  22. After spending hours debugging compatability and configuration issues with django and ruby, it was REALLY nice to have a simple, clean easy method to get started. By doing the videos, there are a lot of things such as changed links, version types, etc that you are able to pick up on.
    Great Job!

    • Works well! It is not obvious, thugoh. Will new users know to click on the yellow bubble or time stamp?Within the thread itself, perhaps you can put the same yellow bubble next to the title of the thread to keep things consistent? Maybe a yellow bubble with a down arrow?

  23. run ‘grails create-app myapp’, get error:
    | Error Error executing script CreateApp: The following error occurred while executing this line: C:\Documents and Settings\Nk\.grails\ivy-cache\org.apache.ant\ant\jars\ant-1.8.2.jar (绯荤粺鎵句笉鍒版寚瀹氱殑璺緞銆? (Use –stacktrace to see the full trace)

    • i know problem what is, cause my login account is Chinese, when I login windows with Administrator, done. why does grails could not support Unicode account?

  24. i install grails followed documentation, and run ‘grails -version’ is right, but when I run ‘grails create-app myapp’, I get error with ant-1.8.x.jar can not be found in directory c:\Document And Settings\Nk\.grails\…
    what about this error? my system is Windows XP SP3, localization is Chinese, and grails was installed in C:\grails-2.0.4, GRAILS_HOME=C:\grails-2.0.4

  25. I am getting an error when I create a new Grail Project in Eclipse. .

    java.lang.NoClassDefFoundError: org/codehaus/groovy/tools/RootLoader
    Exception in thread “main”

    Can you please let me know what the problem is? I have successfully followed the steps so far in the video ..Quick reply would be highly appreciated.I am using jdk1.6.0.3

  26. Really really helpful, I was looking for something like this many months ago, It’s a clear way to show how things works on Grails.
    Great job,Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>