Linux CentOS7安装Gradle-6.3

Linux安装Gradle

Gradle的运行需要依赖jdk,所以在安装Gradle之前我们得先把jdk装上,这里就不讲安装jdk了,网上教程一大堆。

1.下载Gradle安装包,网址链接:https://services.gradle.org/distributions/

  • 进入home/test/目录下,下载Gradle安装包
cd  home/test/
wget https://downloads.gradle-dn.com/distributions/gradle-6.3-bin.zip
  • 解压gradle-6.3-bin.zip安装包
unzip gradle-6.3-bin.zip

2.设置环境变量

在/etc/profile文件底部加两行

注:# /home/test/gradle-6.3/是指安装路径,后加bin目录

vi /etc/profile
export GRADLE_USER_HOME=$PATH:/home/test/gradle-6.3/bin 
export PATH=$PATH:$GRADLE_USER_HOME/bin
source /etc/profile

3.验证是否安装成功

使用 gradle -v 查看

[root@compile-server test]# gradle -v

------------------------------------------------------------
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:          1.8.0_212 (Oracle Corporation 25.212-b04)
OS:           Linux 3.10.0-957.el7.x86_64 amd64

你可能感兴趣的:(gradle)