Linux下安裝gradle

gradle是目前很火的打包工具html

============= 完美的分割線 ==============linux

1.準備工做

1)本教程適用於如下系統環境
CentOS6.9_x64
CentOS7.5_x64tomcat

2)gradle的運行依賴Java環境,須要預先安裝,具體Java安裝方法能夠參考個人另外一篇博文:
linux下yum安裝jdk1.8(rpm包)和tomcat-8.5工具

http://www.javashuo.com/article/p-hhmrzoks-t.htmlgradle

2.安裝gradle

1)下載軟件包ui

# 20180922最新安裝包版本4.10.2spa

mkdir -p /server/tools
cd /server/tools/
wget https://downloads.gradle.org/distributions/gradle-4.10.2-all.zip

2)解壓安裝gradle軟件包3d

unzip -D gradle-4.10.2-all.zip 
mv gradle-4.10.2 /usr/local/gradle
ll /usr/local/gradle
ln -s /usr/local/gradle/bin/gradle  /usr/bin/gradle
ll /usr/bin/gradle

3)配置環境變量code

echo " ">>/etc/profile
echo "# Made for gradle env by zhaoshuai on $(date +%F)">>/etc/profile
echo 'export GRADLE_HOME=/usr/local/gradle'>>/etc/profile
echo 'export PATH=$GRADLE_HOME/bin:$PATH'>>/etc/profile

 

# 使環境變量生效server

tail -4 /etc/profile
source /etc/profile

4)檢查變量配置

echo $PATH

5)查看安裝的mvn版本號

which gradle
gradle -version

# 看到如下返回表示安裝成功

[root@PubCenter tools]# gradle -v
-------------------------
Gradle 4.1
-------------------------
Build time:   2017-08-07 14:38:48 UTC
Revision:     941559e020f6c357ebb08d5c67acdb858a3defc2
Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_65 (Oracle Corporation 25.65-b01)
OS:           Linux 2.6.32-431.el6.x86_64 amd64

======= 完畢,呵呵呵呵 =======

相關文章
相關標籤/搜索