How do I know if Gradle is installed on my machine?

Viewed 13634

I have a Macbook with Android Studio installed. Since I have projects that use Gradle (and Android Studio also uses Gradle), I would assume I have Gradle installed on my machine somewhere. However if I type gradle into the terminal I get command not found. So, do I have Gradle automatically installed because I have Android Studio, or do I have to run brew install gradle ?

I know this is a bad/silly question, but I just want to make sure I don't install Gradle twice.

2 Answers

You shouldn't need to install Gradle at all. The projects are likely using the Gradle wrapper - i.e. you should just be able to run ./gradlew whatever inside their root directories.

In the unlikely case that they're not using the wrapper, then brew install gradle ought to work on a Mac.

(I don't know anything about whether Android Studio deploys Gradle, but if it does, clearly it does so in a way that doesn't play well with your PATH.)

The correct answer can be found here: Gradle home cannot be found on Mac.

Command: brew info gradle

As the result you will have something like this:

gradle: stable 4.0.1
Build system based on the Groovy language
https://www.gradle.org/
/usr/local/Cellar/gradle/3.4 (181 files, 74.5MB) *
Built from source on 2017-02-24 at 15:01:34
From: https://github.com/Homebrew/homebrew-        core/blob/master/Formula/gradle.rb
==> Requirements
Required: java >= 1.7 ✔
==> Options
--with-all
Installs Javadoc, examples, and source in addition to the binaries

Here, on the line 4 you can see the home path: /usr/local/Cellar/gradle/3.4

Related