环境:ubuntu16.04
软件:gradle7.0.2
1、官网下载gradle
gradle官方仅二进制下载链接
2、创建目录并解压文件到本地
root@localhost: mkdir -p /opt/gradle
root@localhost: unzip -d /opt/gradle gradle-7.0.2-bin.zip
root@localhost: ls /opt/gradle/gradle-7.0.2
LICENSE NOTICE bin README init.d lib media
3、定义永久变量,并使其生效
root@localhost: vim /etc/profile
#添加如下两条变量
export GRADLE_HOME=/opt/gradle/gradle-7.0.2
export PATH=$GRADLE_HOME/bin:$PATH
4、重载变量文件
root@localhost: source /etc/profile
检查是否正常
root@localhost: gradle -v
------------------------------------------------------------
Gradle 7.0.2
------------------------------------------------------------
Build time: 2021-05-14 12:02:31 UTC
Revision: 1ef1b260d39daacbf9357f9d8594a8a743e2152e
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_292 (Private Build 25.292-b10)
OS: Linux 4.15.0-142-generic amd64
基本和官方一致,这也算学一点记录一点,所以只能写原创了~~