Centos Gradle Install

5429 ワード

jdk1.8以上

1.インストール

  • 11.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