在Debian 10上安装Gradle
只需要一种选项,用中文将以下内容释义为:假设已安装了Java SE8或更高版本。
下载Gradle
$ wget https://services.gradle.org/distributions/gradle-6.3-bin.zip -P /tmp
解冻
$ sudo unzip -d /opt/gradle /tmp/gradle-*.zip
确认内容
$ ls /opt/gradle/gradle-*
bin init.d lib LICENSE NOTICE README
PATH变量的配置
$ touch /etc/profile.d/gradle.sh
$ vi /etc/profile.d/gradle.sh
在已经创建的gradle.sh文件中添加内容。
export GRADLE_HOME=/opt/gradle/gradle-6.3
export PATH=${GRADLE_HOME}/bin:${PATH}
使其能够执行
$ sudo chmod +x /etc/profile.d/gradle.sh
读取环境变量并确认安装
如果出现像下面这样的消息,就算完成。
$ source /etc/profile.d/gradle.sh
$ gradle -v
Welcome to Gradle 6.3!
Here are the highlights of this release:
- Java 14 support
- Improved error messages for unexpected failures
For more details see https://docs.gradle.org/6.3/release-notes.html
------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------
Build time: 2020-03-24 19:52:07 UTC
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60
Kotlin: 1.3.70
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.9.1 (Debian 11.0.9.1+1-post-Debian-1deb10u2)
OS: Linux 5.4.72-microsoft-standard-WSL2 amd64