Rob
Rob

Reputation: 16002

Grails is not recognized as an internal or external command (Windows 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.

Upvotes: 7

Views: 9080

Answers (4)

Jessica Campos
Jessica Campos

Reputation: 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.

Upvotes: -1

user1811107
user1811107

Reputation: 759

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

Upvotes: 1

Daniel Wondyifraw
Daniel Wondyifraw

Reputation: 7723

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 

Upvotes: 3

dev
dev

Reputation: 715

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.

Upvotes: 2

Related Questions