最近刚开始用gradle,先向大家介绍一下怎么配置gradle的环境变量吧:
1、下载最新安装包gradle-xxx-all.zip:http://www.gradle.org,并解压到/Users/Admin目录下
2、在终端输入以管理员的权限打开.bash_profile文件命令:sudo vim ~/.bash_profile
3、设置环境变量:
GRADE_HOME=/Users/Admin/gradle;
export GRADE_HOME
export PATH=/opt/local/bin:/opt/local/sbin:$PATH:$GRADE_HOME/bin
4、保存.bash_profile文件后执行source ~/.bash_profile
5、查看gradle是否配置成功命令:gradle -version,若成功输出如下提示:
------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------
Build time: 2014-02-11 11:34:39 UTC
Build number: none
Revision: a831fa866d46cbee94e61a09af15f9dd95987421
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy: 2.2.0
JVM: 1.6.0_65 (Apple Inc. 20.65-b04-462)
OS: Mac OS X 10.8.5 x86_64