Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 hereenter 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.

like image 328
Rob Avatar asked Nov 18 '13 10:11

Rob


3 Answers

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 
like image 73
Daniel Adenew Avatar answered Oct 13 '22 04:10

Daniel Adenew


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.

like image 30
dev Avatar answered Oct 13 '22 03:10

dev


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

like image 1
user1811107 Avatar answered Oct 13 '22 04:10

user1811107