Linux Ubuntu cheap maven

The main steps of maven download address
:

下载压缩包
解压缩
转移至固定目录(可选)
配置环境变量
检查是否安装成功
另一种安装方法 是直接使用命令:sudo apt-get install maven

Installation process:
1. Download the compressed package

$ wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

2. Unzip

$ tar zxvf apache-maven-3.6.3-bin.tar.gz
$ # 解压完成后生成一个目录:apache-maven-3.6.3

3. Transfer to a fixed directory (optional, but recommended)

$ # 推荐放在 /usr 下
$ sudo mv apache-maven-3.6.3 /usr/

4. Configure environment variables

$ gedit /etc/profile
在编辑器里面输入下面
export MAVEN_HOME=/usr/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$PATH 

保存
$ source /etc/profile

5. Check if the installation is successful

$ mvn -v
Apache Maven 3.6.3 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
Maven home: /usr/local/maven/apache-maven-3.6.3
Java version: 1.8.0_283, vendor: Oracle Corporation, runtime: /usr/lib/java/jdk1.8.0_283/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-93-generic", arch: "amd64", family: "unix"

That is: after executing mvn -v, the version number is obtained, which proves that the installation is successful.

Guess you like

Origin blog.csdn.net/qq_16733389/article/details/115140513