小编典典

在Mac上找不到Gradle home

java

我已经gradle使用终端在MAC 上安装了。

brew install gradle

Gradle已成功安装。

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

但是我找不到gradle家。

echo $GRADLE_HOME
[empty result]

确定主目录的第一步是检测gradle指令的位置:

which gradle
/usr/local/bin/gradle

有无法理解的bash文件。


任何想法如何通过终端检测gradle主目录?


阅读 860

收藏
2020-12-03

共1个答案

小编典典

您可以使用命令:

brew info gradle

结果,您将获得以下内容:

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

在第4行上,您可以看到起始路径: /usr/local/Cellar/gradle/3.4

2020-12-03