下载安装
下载
#这里是下载3.5的版本
wget https://services.gradle.org/distributions/gradle-3.5-bin.zip
解压
unzip gradle-3.5-bin.zip
#我执行该命令出现一个异常
[root@izwz9fnvr82ccmxil6csgvz /]# unzip gradle-3.5-bin.zip
-bash: unzip: command not found
#原因是服务器没有安装unzip,我们下载并安装就可以解决
[root@izwz9fnvr82ccmxil6csgvz /]# yum install -y unzip zip
移动到/usr/local/
mv gradle-2.7 /usr/local/
配置
## vim /etc/profile
export GRADLE_HOME=/usr/local/gradle-2.7
PATH=$PATH:$GRADLE_HOME/bin
## source /etc/profile 启动新的配置
source /etc/profile
测试
#是需要在有jdk的基础下安装
[root@izwz9fnvr82ccmxil6csgvz jdk]# gradle -v
------------------------------------------------------------
Gradle 3.5
------------------------------------------------------------
Build time: 2017-04-10 13:37:25 UTC
Revision: b762622a185d59ce0cfc9cbc6ab5dd22469e18a6
Groovy: 2.4.10
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_151 (Oracle Corporation 25.151-b12)
OS: Linux 3.10.0-514.26.2.el7.x86_64 amd64
[root@izwz9fnvr82ccmxil6csgvz jdk]#
网友评论