在Ubuntu 18.04環境下安裝Gradle5

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章