Ubuntu环境安装Gradle

AndroidStudio使用全新的构建系列—–Gradle。

这是官方为什么使用gradle 的理由:

  • Domain Specific Language (DSL) to describe and manipulate the build logic
  • Build files are Groovy based and allow mixing of declarative elements through the DSL and using code to manipulate the DSL elements to provide custom logic.
  • Built-in dependency management through Maven and/or Ivy.
  • Very flexible. Allows using best practices but doesn’t force its own way of doing things.
  • Plugins can expose their own DSL and their own API for build files to use.
  • Good Tooling API allowing IDE integration

在Ubuntu安装Gradle也是很简单。切记请勿使用apt-get安装Gradle。因为Ubuntu源的Gradle实在太旧。我用的搜狐的源,竟然是2011年。

下面是安装步骤:

1、在官网下载最新的Gradle版本。http://www.gradle.org/downloads

2、解压安装包到目录

 

 

 

 

 

3、

 

打开环境文件

 

 

 sudo vim /etc/profile

4、写入环境变量:

 

 

 

 

export GRADLE_HOME=/opt/gradle/gradle-2.0 

export PATH=$GRADLE_HOME /bin :$PATH

 

5、环境变量生效source /etc/profile

6、检查结果

gradle -v

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值