Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle executable not found on Windows 7

This is the first time of using [Gradle][1], using version 2.1.

I unzipped the zip file to the directory D:\JavaTools\gradle-2.1. I updated the environment variables ,and restarted my machine.But this is the result of testing:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>ECHO %GRADLE_HOME%
D:\JavaTools\gradle-2.1

C:\Users\Administrator>ECHO %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind
owsPowerShell\v1.0\;%JAVA_HOME%\bin;%GRADLE_HOME%\bin

C:\Users\Administrator>gradle -version
'gradle' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Administrator>d:

D:\>cd D:\JavaTools\gradle-2.1

D:\JavaTools\gradle-2.1>gradle -version
'gradle' is not recognized as an internal or external command,
operable program or batch file.

D:\JavaTools\gradle-2.1>cd bin

D:\JavaTools\gradle-2.1\bin>gradle -version

------------------------------------------------------------
Gradle 2.1
------------------------------------------------------------

Build time:   2014-09-08 10:40:39 UTC
Build number: none
Revision:     e6cf70745ac11fa943e19294d19a2c527a669a53

Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_11 (Oracle Corporation 25.11-b03)
OS:           Windows 7 6.1 x86

D:\JavaTools\gradle-2.1\bin>

I'm really very confused. I just want to import the spring-framework source code from github to my Eclispe or IntelliJ.If you have other solutions ,pls tell me ! Thanks!!!!

like image 812
Frank Avatar asked Oct 12 '14 15:10

Frank


1 Answers

I had a similar issue.The system variable %GRADLE_HOME% wasn't being created for some reason.

echo %GRADLE_HOME% returned %GRADLE_HOME% for example.

So I set the variable with setx, which comes with win 7 and above. Download this to use it in XP.

  • Run cmd.exe in administrator.
  • Write setx GRADLE_HOME <path to gradle> /m

example setx GRADLE_HOME C:\Programming\gradle\gradle-2.4 /m

Reset cmd and test with echo %GRADLE_HOME%. Then add %GRADLE_HOME%\bin to your path system variable.

like image 174
Olavi Sau Avatar answered Oct 03 '22 21:10

Olavi Sau