Original link: https: //www.cnblogs.com/wkrbky/p/6350334.html
Maven installation configuration (Windows 10)
Want to install Apache Maven on a Windows system, you need to download Maven zip file and unzip it to the directory where you want to install and configure Windows environment variables.
Tools required:
- JDK 1.8
- Maven 3.3.9
- Windows 10
Maven 3.2 requires JDK 1.6 or above, while Maven 3.0 / 3.1 or more requires JDK 1.5
1. JDK and JAVA_HOME
Make sure that the installed JDK, and "JAVA_HOME" variable has been added to the Windows environment variables.
To operate according to the above numerical order, in this tutorial, install the JDK is JDK1.8, in order to facilitate learning, I suggest you also install and use JDK1.8.
2. Download Apache Maven
Access Maven official website , find the download link opens, as follows:
Maven download zip file, for example: apache-maven-3.3.9-bin.zip , extract it to a file you want to install Maven folder.
Suppose you extract the files to a folder - D: \ apache \ maven \ apache-maven-3.3.9
Note: At this stage, only the folders and files, as installed Tomcat general.
3. Add M2_HOME and MAVEN_HOME
Add M2_HOME and MAVEN_HOME environment variable to the Windows environment variables, and point it to your Maven folder.
Maven 说只是添加 M2_HOME , 但一些项目仍引用 Maven 的文件夹 MAVEN_HOME, 因此,为了安全也把它添加进去。
4. 添加到环境变量 - PATH
更新 PATH 变量,添加 Maven bin 文件夹到 PATH 的最后,如: %M2_HOME%\bin, 这样就可以在命令中的任何目录下运行 Maven 命令了。
5. 验证
完成,以验证它,执行 mvn –version 在命令提示符下,如下图输出结果:
如果你看到类似消息,说明 Apache Maven 在 Windows 上已安装成功。
想要安装 Apache Maven 在Windows 系统上, 需要下载 Maven 的 zip 文件,并将其解压到你想安装的目录,并配置 Windows 环境变量。
所需工具 :
- JDK 1.8
- Maven 3.3.9
- Windows 10
Maven 3.2 要求 JDK 1.6 或以上版本, 而 Maven 3.0/3.1 需要 JDK 1.5 或以上
1. JDK 和 JAVA_HOME
确保已安装JDK,并 “JAVA_HOME” 变量已加入到 Windows 环境变量。
操作要以按上面数字顺序,在这个教程中,安装的 JDK 是 JDK1.8,为了方便学习,建议你也安装使用 JDK1.8。
2. 下载 Apache Maven
访问 Maven官方网站,打开后找到下载链接,如下:
下载 Maven 的 zip 文件,例如: apache-maven-3.3.9-bin.zip,将它解压到你要安装 Maven 的文件夹。
假设你解压缩到文件夹 – D:\apache\maven\apache-maven-3.3.9
注意:在这一步,只是文件夹和文件,如同安装Tomcat一般。
3. 添加 M2_HOME 和 MAVEN_HOME
添加 M2_HOME 和 MAVEN_HOME 环境变量到 Windows 环境变量,并将其指向你的 Maven 文件夹。
Maven 说只是添加 M2_HOME , 但一些项目仍引用 Maven 的文件夹 MAVEN_HOME, 因此,为了安全也把它添加进去。
4. 添加到环境变量 - PATH
更新 PATH 变量,添加 Maven bin 文件夹到 PATH 的最后,如: %M2_HOME%\bin, 这样就可以在命令中的任何目录下运行 Maven 命令了。
5. 验证
完成,以验证它,执行 mvn –version 在命令提示符下,如下图输出结果:
如果你看到类似消息,说明 Apache Maven 在 Windows 上已安装成功。