[LINUX] How to install Maven on CentOS

--Environment - CentOS Linux release 7.6.1810 (Core) - tar (GNU tar) 1.26 - GNU Wget 1.14 built on linux-gnu.

Download the archive

# 1.Switch to root user
$ sudo su -
[sudo] password for ponsuke: 

# 2.to download
# wget https://www.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
--2020-04-02 16:32:40--  https://www.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
Resolving www.apache.org (www.apache.org)... 40.79.78.1, 95.216.24.32, 2a01:4f9:2a:185f::2
...abridgement...
100%[=========================================================================================================================================================================>] 7,956,528   2.58MB/s   in 2.9s   

2020-04-02 16:33:48 (2.58 MB/s) - ‘apache-maven-3.2.5-bin.tar.gz’ saved [7956528/7956528]

Unzip and place

# tar xzvf apache-maven-3.2.5-bin.tar.gz -C /opt/
apache-maven-3.2.5/README.txt
...abridgement...
apache-maven-3.2.5/lib/slf4j-simple-1.7.5.jar

Pass through

# 1.Switch from root user to yourself
# exit
logout

# 2. .bash_Set the path in profile
$ vi ~/.bash_profile
↓ Add this
PATH=$PATH:/opt/apache-maven-3.2.5/bin/
↓ Before this ↑ Write this
export PATH

# 3. .bash_Reflect profile
$ source ~/.bash_profile 
[1]+  Done                    exec ibus-daemon -dx

# 4.Check PATH
$ printenv PATH
/sbin:/bin:...abridgement...:/opt/apache-maven-3.2.5/bin/

Take a look at the version to see if Maven works

#Caution:Command is not maven
$ maven --version
bash: maven: command not found

#mvn is correct
$ mvn --version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T02:29:23+09:00)
Maven home: /opt/apache-maven-3.2.5
Java version: 1.8.0_212, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre
Default locale: ja_JP, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.12.2.el7.x86_64", arch: "amd64", family: "unix"

Recommended Posts

How to install Maven on CentOS
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
How to install Apache (httpd) on CentOS7
How to install Apache (httpd) on CentOS8
How to install mysql-connector-python on mac
Steps to install VirtualBox on CentOS
How to install graph-tool on macOS
How to install Git GUI and Gitk on CentOS
How to install VMware-Tools on Linux
How to install pycrypto on Windows
How to install OpenCV on Mac
[AWS EC2] How to install Maven on Amazon Linux 2
How to install Go on Ubuntu
How to install music 21 on windows
How to install Python2.7 python3.5 with pyenv (on RHEL5 CentOS5) (2016 Nov)
How to install aws-session-manager-plugin on Manajro Linux
[Kivy] How to install Kivy on Windows [Python]
How to install packages on Alpine Linux
How to switch mouse operations on CentOS
How to install richzhang / colorization on Windows 10
How to install php7.4 on Linux (Ubuntu)
How to install NumPy on Raspberry Pi
How to install cx_Oracle on macOS Sierra
How to install python3 with docker centos
How to install Python
How to install pip
How to install archlinux
Install numba on CentOS 7.2
How to install python
Install Python3.4 on CentOS 6.6
How to install BayesOpt
Install mecab-python on CentOS
Install Python 2.7.3 on CentOS 5.4
How to install Nbextensions
How to install Prover9
Install awscli on centos7
Install Chainer on CentOS 6.7
[2020 version] How to install Python3 on AWS EC2
How to install OpenCV on Jetson Nano Python
How to quickly install h5py on Windows 10 [Unofficial]
How to install OpenGM on OSX with macports
How to install Camunda Modeler on Manjaro Linux
[Python] How to install OpenCV on Anaconda [Windows]
How to install / verify graphviz on anaconda / windows10
[2020.8 latest] How to install Python
How to install Python [Windows]
Tabpy 1.0 (2020-01 version) How to install
Install ImageMagick-6.2.x series on CentOS7.7
Install Python 3.8 on CentOS 7 (SCL)
How to register on pypi
How to install mkl numpy
Install Chrome on CentOS 7 series
How to install Pelican blog
How to install Linux on a 32bit UEFI PC
How to install git on Linux such as EC2
How to install python using anaconda
Steps to deploy EMLauncher on CentOS 8
raspberry pi 4 centos7 install on docker
How to install and use Tesseract-OCR
Steps to install matplotlib on Mac