1. mac中安装gradle
- 通过brew安装gradle
brew install gradle
- 配置JAVA_HOME环境变量
export JAVA_HOME=$(/usr/libexec/java_home)
至此,gradle安装成功
2. idea中配置gradle
配置位置:
idea->Settings->Build,Execution,Deployment->Build Tools->Gradle
配置项:
- 配置Gradle user home
此目录为gradle存储下载文件的目录,一般为/Users/your.name/.gradle
2)配置gradle安装目录
Use Gradle from:选择Specified Location
location填写:可通过brew list gradle查找gradle安装位置,填以/libexec结尾的路径,比如/Users/your.name/homebrew/Cellar/gradle/8.3/libexec