使用MacPorts安装Mac上的Gradle:Gradle home在哪里?

时间:2017-08-15 19:13:18

标签: macos gradle macports

我使用MacPorts安装了Gradle,现在我无法找到Gradle home的位置。例如,Eclipse询问我的位置,我不知道:

Eclipse asking me for Gradle home

我尝试指定从which gradle获取的路径:

$ which gradle
/opt/local/bin/gradle

但它不起作用。那么,Gradle家在哪里?

1 个答案:

答案 0 :(得分:1)

事实证明,MacPorts在安装/升级Gradle时告诉您Gradle home。安装日志以以下内容结束:

--->  Some of the ports you installed have notes:
  gradle has the following notes:
    Remember to set the environment variable GRADLE_HOME 
    to the path to the gradle distribution:
    /opt/local/share/java/gradle

因此,在这种情况下正确的Gradle家庭是:

/opt/local/share/java/gradle

这适用于上面提到的Eclipse场景。