Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to install Maven in Linux

Shulou Source: shulou.com Published: 2022-06-02 10:20:52 10月29日 Update

In this issue, the editor will bring you about how to install Maven in Linux. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

1. Upload

Use xftp to upload the maven package to the file directory (/ home/xxx/maven) specified by the server itself

2. Decompression

Log in to the Linux server using xshell, jump to the specified file directory (/ home/xxx/maven), and execute the decompression command tar-xzvf xxx.tar.gz

3. Configure environment variables (depending on whether the individual wants to be configured as a global or a local user)

A > global (administrator privileges are required)

First switch to the root user and then edit the / etc/profile file to add the following.

# set maven env

Export MAVEN_HOME=/home/xxx/maven/apache-maven-3.6.1

Export PATH=$ {MAVEN_HOME} / bin:$ {PATH}

B > individual (no administrator privileges required)

Edit the / home/xxx/.bashrc file to add the following.

# set maven env

Export MAVEN_HOME=/home/xxx/maven/apache-maven-3.6.1

Export PATH=$ {MAVEN_HOME} / bin:$ {PATH}

4. Load the newly configured environment parameters

A > global

Source / etc/profile

B > individual

Source / home/xxx/.bashrc

5. Verification

It is a success if you enter mvn-v in the command window with the correct prompt.

The above is how to install Maven in the Linux shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Content files individuals configuration global commands servers permissions environment users directories administrators analysis services management success professional small and medium rich content parameters Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information OPPO Reno macOS NVidia Linux