Install maven under CentOS Linux 7

Linux install maven

0 install java jdk

The content of this section is not mentioned here, wait for me to write a blog and then send it to the portal

1. Download maven

Portal: maven official download address .

insert image description here

2. Upload to liunx host

Recommended path /usr/local

  1. Use the tool to upload to the /usr/local directory of the liunx host

insert image description here

  1. decompress

insert image description here

Unzip the command tar -zxvf apache-maven-3.6.3-bin.tar.gz
Note:
1. The tar package name should be the same as the one you downloaded
2. Execute the command in the directory where you store the jar package

  • Rename (can be omitted, personal habits)

insert image description here

3. Modify environment variables

What needs to be modified

MAVEN_HOME=/usr/local/maven (注:这个路径替换成你的解压目录)
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
  1. Open the profile file (vim /etc/profile)
  2. Add environment variables at the end
    insert image description here
  3. Refresh the environment variables to make the environment variables take effect (source /etc/profile)

4. Verify

mvn -v If the version information is output, the configuration is successful

insert image description here

write at the end

I am a pure novice, and the blog I wrote was also written because of the problems encountered in learning and use, after searching for materials and solving them. If there are some errors or infringements, please contact me.

QQ: 994961015
Email: [email protected]

Guess you like

Origin blog.csdn.net/qq_37274323/article/details/104596090