Centos Gradle Install

jdk1.8 이상

1. 설치

  • 1.1 다운로드
# wget 설치(선택사항)
sudo yum install wget
# gradle.zip 다운로드
sudo wget https://services.gradle.org/distributions/gradle-7.0.2-bin.zip
  • 1.2 압축해제
# unzip 설치(선택사항)
sudo yum install unzip
# 압축해제
sudo mkdir -p /opt/gradle; sudo unzip -d /opt/gradle gradle-7.0.2-bin.zip
  • 1.3 파일확인
sudo ls -al /opt/gradle/gradle-7.0.2
total 44
drwxr-xr-x 5 root root    85 Feb  1  1980 .
drwxr-xr-x 4 root root    44 Apr 19 18:14 ..
drwxr-xr-x 2 root root    38 Feb  1  1980 bin
drwxr-xr-x 2 root root    24 Feb  1  1980 init.d
drwxr-xr-x 3 root root  8192 Feb  1  1980 lib
-rw-r--r-- 1 root root 23606 Feb  1  1980 LICENSE
-rw-r--r-- 1 root root   803 Feb  1  1980 NOTICE
-rw-r--r-- 1 root root   976 Feb  1  1980 README

2. 환경변수 설정

  • 2.1 스크립트 생성
sudo vi /etc/profile.d/gradle.sh
export GRADLE_HOME=/opt/gradle/gradle-7.0.2
export PATH=${GRADLE_HOME}/bin:${PATH}
  • 2.2 권한부여 및 갱신
sudo chmod +x /etc/profile.d/gradle.sh; source /etc/profile.d/gradle.sh

3. 설치 확인

gradle -v
------------------------------------------------------------
Gradle 7.0.2
------------------------------------------------------------
Build time:   2021-05-14 12:02:31 UTC
Revision:     1ef1b260d39daacbf9357f9d8594a8a743e2152e
Kotlin:       1.4.31
Groovy:       3.0.7
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          11.0.11 (Red Hat, Inc. 11.0.11+9-LTS)
OS:           Linux 3.10.0-1062.12.1.el7.x86_64 amd64

* 설치 Shell Script (Git 주소)

https://gitlab.com/gjcjd0805/Reference-Room/-/blob/main/linux/gradle-install.sh

sudo chmod +x gradle-install.sh; ./gradle-install.sh

좋은 웹페이지 즐겨찾기