I've installed gradle
on MAC using terminal.
brew install gradle
Gradle has been installed successfully.
gradle -v ------------------------------------------------------------ Gradle 3.3 ------------------------------------------------------------ Build time: 2017-01-03 15:31:04 UTC Revision: 075893a3d0798c0c1f322899b41ceca82e4e134b Groovy: 2.4.7 Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015 JVM: 1.8.0_112 (Oracle Corporation 25.112-b16) OS: Mac OS X 10.12.3 x86_64
but I can not find gradle home.
echo $GRADLE_HOME [empty result]
the first step to determine home directory is detect location of gradle
instruction:
which gradle /usr/local/bin/gradle
there is incomprehensible bash file.
Any ideas how to detect gradle home directory via terminal?
Open Preferences -> Build, Execution, Deployment -> Gradle . Select Use local gradle distribution and specify Gradle home . On Mac: /usr/local/opt/gradle/libexec in case you installed it via brew . For Windows: specify the path where you installed Gradle.
The Gradle plugin (which includes a packaged version of gradle) should already be installed at where/you/installed/android-studio/plugins/gradle, so you shouldn't need to download it manually. That last directory may be where/you/installed/android-studio/gradle/gradle-1.1.
Verify Gradle Installation. Now open the command prompt. In the command prompt, enter Gradle -version. It will display the current version of Gradle just installed on the screen.
You can use 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
You can retrieve the path for GRADLE_HOME
automatically using the following snippet in your .bashrc
or .zshrc
:
export GRADLE_HOME=$(brew info gradle | grep /usr/local/Cellar/gradle | awk '{print $1}')
This is handy when the path to Gradle's home changes, when Gradle is updated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With