travis
travis

Reputation: 65

Running gradle -version does not return proper information

I will start of by saying I have set up gradle on multiple machines before without issue.

On one particular machine, I have set up gradle, but when I run "gradle - version", I get the following output:

enter image description here

No matter what gradle command I run, it always outputs the same information as above. For examples if I run "gradle tasks" it will still return what you see above. "gradle -version" should be something similar to this:


Gradle 2.6

Build time: 2015-08-10 13:15:06 UTC

Build number: none

Revision: 233bbf8e47c82f72cb898b3e0a96b85d0aad166e

Groovy: 2.3.10

Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013

JVM: 1.7.0_67 (Oracle Corporation 24.65-b04)

OS: Windows 7 6.1 amd64

Any information on how to get this corrected is greatly appreciated. Thank you.

Upvotes: 1

Views: 298

Answers (3)

Vaibhav Pawar
Vaibhav Pawar

Reputation: 29

Did you check the GRADLE_HOME value you set in your environment variables? If that is pointing to your previous version, you need to change that.

I am on a mac and for me, I had this value in my .bash_profile

export GRADLE_HOME=/usr/local/Cellar/gradle/3.4.1

I changed it to

export GRADLE_HOME=/usr/local/Cellar/gradle/latest

Now gradle --version returns latest version as 4.0.1 which I installed a few mins ago. I believe, I won't have to change it any more now!

Upvotes: 0

Eric Wendelin
Eric Wendelin

Reputation: 44349

A couple possibilities:

  • Does gradle --version behave differently?
  • Is there a build.gradle file in that folder? This is the default message when Gradle cannot find a build file.
  • Do you have any content in a gradle.properties file in that folder? Invalid properties may cause gradle to always return the output of :help.

I hope one of those is helpful, at least.

Upvotes: 2

mschenk74
mschenk74

Reputation: 3591

enter image description here The output you posted above is the output of gradle :help and not the output of gradle -version.

If you omit the :help from your command it should print the correct output. (The :help is on the second line of your command line, see red marker on your screenshot)

Upvotes: 0

Related Questions