1、安装jdk8
apt update
apt install openjdk-8-jdk -y
java -version
2、安装Gradle
wget https://services.gradle.org/distributions/gradle-5.0-bin.zip -P /tmp
unzip -d /opt/gradle /tmp/gradle-*.zip
ls /opt/gradle/gradle-5.0
3、配置Gradle环境
nano /etc/profile.d/gradle.sh
# gradle.sh内容
export GRADLE_HOME=/opt/gradle/gradle-5.0
export PATH=${GRADLE_HOME}/bin:${PATH}
# 保存设置执行权限
chmod +x /etc/profile.d/gradle.sh
source /etc/profile.d/gradle.sh
gradle -v
4、安装效果
Welcome to Gradle 5.0!
Here are the highlights of this release:
- Kotlin DSL 1.0
- Task timeouts
- Dependency alignment aka BOM support
- Interactive `gradle init`
For more details see https://docs.gradle.org/5.0/release-notes.html
------------------------------------------------------------
Gradle 5.0
------------------------------------------------------------
Build time: 2018-11-26 11:48:43 UTC
Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987
Kotlin DSL: 1.0.4
Kotlin: 1.3.10
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_181 (Oracle Corporation 25.181-b13)
OS: Linux 4.15.0-36-generic amd64