--Environment - CentOS Linux release 7.6.1810 (Core) - tar (GNU tar) 1.26 - GNU Wget 1.14 built on linux-gnu.
# 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]
# 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
# 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/
#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