0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CentOS7 OpenJDK Maven Install

Last updated at Posted at 2020-05-31

はじめに

CentOS 7 に OpenJDK と Maven を Install する手順を備忘録としてメモります

CentOS 7

適当に作成

OpenJDK 8

Install

sudo yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel java-1.8.0-openjdk-src

OpenJDK 11

Open JDK 11 の場合はこちら

sudo yum install -y java-11-openjdk java-11-openjdk-devel java-11-openjdk-src

Maven 3.6.3 Install

依存関係を管理するために、Maven を Install します。

以下のURLでダウンロードURLを確認します。
https://maven.apache.org/download.cgi

1587385604751.png

ダウンロードページでコピーしたURLを使って、CentOS 上に tar.gz ファイルをダウンロードします

mkdir ~/maven
cd ~/maven
wget https://ftp.jaist.ac.jp/pub/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

次の手順に従ってインストールしていきます。
https://maven.apache.org/install.html

tar.gz ファイルを解凍

tar xfvz apache-maven-3.6.3-bin.tar.gz

環境変数設定
bashrc に追記

echo 'export PATH=$PATH:$HOME/maven/apache-maven-3.6.3/bin' >> ~/.bashrc

bashrc 再読み込み

source ~/.bashrc

mvn コマンドが実行可能確認します

[opc@maven maven]$ mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/opc/maven/apache-maven-3.6.3
Java version: 1.8.0_252, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.10.0-1127.8.2.el7.x86_64", arch: "amd64", family: "unix"
[opc@maven maven]$
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?