7

I don't know what I'm doing wrong...

First I've downloaded, and unzipped the folder in C:\ :

enter image description here enter image description here

Then, set it as a user variable :

enter image description here

And added it to my PATH :

enter image description here

And even after restarting cmd, when I check grails -version I get this :

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

What is wrong? Thanks for your help.

Rob
  • 15,732
  • 22
  • 69
  • 107

4 Answers4

3

First try this one on CMD commandline type

echo %GRAILS_HOME%

Then type path and see if the grails paths is something like :

C:\Windows\system32;C:\Windows;C:\grails2.1.1

ok , if in any case i sugget you replace the GRAILS_HOME with C:\grails2.1.1

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Win‌​d owsPowerShell\v1.0\;%JAVA_HOME%\bin;%GRAILS_HOME%\bin;

with

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Win‌​d owsPowerShell\v1.0\;%JAVA_HOME%\bin;c:\grails2.1.1\bin;

Then logout or restart the PC it should work ,if not check your package of grails for a file names grails.bat something or try to run it by giving the exact path from CMD!!

like :

cmd > c:\grails2.1.1\bin\startGrails.bat 
Develop4Life
  • 7,581
  • 8
  • 58
  • 76
2

To troubleshoot what is the error using CD go to the location C:\Grails\bin and execute the command grails.bat, if it executes then check for path again else there is problem in grails downloaded jar.

dev
  • 715
  • 5
  • 21
  • It executes, but after checking again and again the paths, they just seem to be right. – Rob Nov 18 '13 at 12:35
  • just execute the "path" command in command prompt.check if it showing any % value. – dev Nov 18 '13 at 12:39
  • `PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32 \WindowsPowerShell\v1.0\;%GRAILS_HOME%\bin;%JAVA_HOME%\bin` – Rob Nov 18 '13 at 12:46
  • 1
    %--% values are not getting converted.for now use complete path like C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Win‌​d owsPowerShell\v1.0\;C:\Program Files (x86)\Java\jdk1.7.0_13\bin;c:\grails2.1.1\bin; – dev Nov 18 '13 at 13:22
1

Make sure you do not have spaces or special characters in the following paths

  1. e.g. JDK path it should be JAVA_HOME=C:\Java7\jdk1.7.0_40

  2. GRAILS_HOME path (use underscores or hyphens) e.g. c:\grails_221

  3. Check the java version by using the command - java -version, many times this is not set correctly

  4. Finally make sure your bin directories are appended to your PATH variable

Also check - http://grails.org/installation

user1811107
  • 729
  • 3
  • 18
  • 39
-1

The problem is the - character in folder's name.

Instead of grails-2.1.1 use grails2.1.1 and it will work perfectly.

  • ... and the path in the screenshot clearly shows that the actual folder name is hyphenated. – Antti Haapala -- Слава Україні Sep 23 '16 at 21:22
  • Welcome to [SO]! Please visit the [Help Center](http://stackoverflow.com/help) for tips on using the site, such as [how to write a great answer](http://stackoverflow.com/help/how-to-answer). In this case, for example, you answered an ancient question that already has an accepted answer, and you did not provide any evidence to indicate that your answer is better than/equivalent to the accepted one. – dg99 Sep 23 '16 at 21:23