Apache Maven is the most popular project management tool for Java applications. We can install maven on any operating system.

Apache Maven是最流行的Java应用程序项目管理工具。 我们可以在任何操作系统上安装maven。

在Windows上安装Maven (Installing Maven on Windows)

Maven requires JDK to execute. Maven 3.3+ requires JDK 1.7 or above to execute. Let’s look into the various steps to install Maven on Windows.

Maven需要JDK执行。 Maven 3.3+需要JDK 1.7或更高版本才能执行。 让我们研究在Windows上安装Maven的各种步骤。

1.在Windows上安装JDK (1. Install JDK on Windows)

We can install Oracle JDK using the executable file. But, for this tutorial, we will install OpenJDK. OpenJDK is free to use and we don’t need to worry about licenses or to pay Oracle for support.

我们可以使用可执行文件安装Oracle JDK。 但是,对于本教程,我们将安装OpenJDK。 OpenJDK是免费使用的,我们无需担心许可证问题或向Oracle支付支持费用。

Java Windows Download InstallJava Windows下载安装

1.1)下载OpenJDK Binaries ZIP文件 (1.1) Download OpenJDK Binaries ZIP File)

Go to the JDK Download URL: https://jdk.java.net/13/

转到JDK下载URL: https : //jdk.java.net/13/

Download the binaries for Windows/x64 as shown in the below image.

下载Windows / x64的二进制文件,如下图所示。

Download OpenJDK for Windows

下载适用于Windows的OpenJDK

Extract it to any place you want. I have extracted it to C:\Program Files\Java folder.

将其解压缩到您想要的任何位置。 我已将其解压缩到C:\Program Files\Java文件夹。

1.2)设置环境变量– JAVA_HOME和Path (1.2) Setting up Environment Variables – JAVA_HOME and Path)

We have to set JAVA_HOME and add the JDK binaries folder to the Path variable.

我们必须设置JAVA_HOME并将JDK Binaries文件夹添加到Path变量。

You can search for “edit environment variables” or go to “Control Panel -> System and Security -> System” and click on the “Advanced system settings” link in the left sidebar.

您可以搜索“编辑环境变量”或转到“控制面板->系统和安全性->系统”,然后单击左侧栏中的“高级系统设置”链接。

In the “System Properties” popup, go to the “Advanced” tab and click on the “Environment Variables” button. This will open a new popup window to edit user and system environment variables.

在“系统属性”弹出窗口中,转到“高级”选项卡,然后单击“环境变量”按钮。 这将打开一个新的弹出窗口,以编辑用户和系统环境变量。

Now, create a new system environment variable “JAVA_HOME” with value as the location of the JDK folder.

现在,创建一个新的系统环境变量“ JAVA_HOME”,其值作为JDK文件夹的位置。

Also, add the JDK bin folder to the Path variable list of directories.

另外,将JDK bin文件夹添加到目录的Path变量列表中。

1.3)通过命令提示符验证Java安装 (1.3) Verifying Java Installation through Command Prompt)

Open the command prompt and type java -version command. It should print the JDK version installed by you.

打开命令提示符,然后键入java -version命令。 它应该打印您安装的JDK版本。

Check Java Version Command Prompt

检查Java版本命令提示符

2.在Windows上安装Maven (2. Install Maven on Windows)

Once the JDK is properly installed and configured, we can move ahead with the installation of the maven.

一旦正确安装并配置了JDK,我们就可以继续安装Maven。

2.1)下载Maven Binary zip存档 (2.1) Download Maven Binary zip Archive)

Go to the URL: https://maven.apache.org/download.cgi

转到URL: https : //maven.apache.org/download.cgi

Download the “Binary zip archive” as shown in the below image.

如下图所示,下载“二进制zip存档”。

Download Maven Binary Zip Archive

下载Maven Binary Zip存档

2.2)设置Maven环境变量– M2_HOME,MAVEN_HOME,路径 (2.2) Setting up Maven Environment Variables – M2_HOME, MAVEN_HOME, Path)

First of all, extract the downloaded maven zip file to any folder of your choice. I have extracted it to C:\Program Files\apache-maven-3.6.3.

首先,将下载的maven zip文件解压缩到您选择的任何文件夹中。 我已经将其提取到C:\Program Files\apache-maven-3.6.3

Now, use the below image to create the M2_HOME and MAVEN_HOME variables. Also, add the maven bin folder to the Path variable.

现在,使用下图创建M2_HOME和MAVEN_HOME变量。 另外,将maven bin文件夹添加到Path变量。

Setting Maven Environment Variables

设置Maven环境变量

2.3)通过命令提示符验证Maven安装 (2.3) Verifying Maven Installation through Command Prompt)

Open command prompt and type mvn -version command. It should print the maven version, maven bin folder location, and the Java version it’s using.

打开命令提示符,然后键入mvn -version命令。 它应该显示Maven版本,Maven Bin文件夹位置以及所使用的Java版本。

Checking Maven Version Command Prompt

检查Maven版本命令提示符

That’s it. Maven is successfully installed and you can use it to create and manage Java projects.

而已。 Maven已成功安装,您可以使用它来创建和管理Java项目。

参考资料 (References)

  • Apache Maven HomepageApache Maven主页
  • JDK 13 GA Release PageJDK 13 GA发行页面

翻译自: https://www.journaldev.com/33567/install-maven-windows

如何在Windows上安装Maven相关推荐

  1. java 中window_教你如何在windows上安装Java

    最近够倒霉的,电脑硬盘坏了,重新做了个系统,各种环境全都没了,/(ㄒoㄒ)/~~ 然后我发现自己在重新安装各种环境的时候,有些东西竟然还需要去查,所以决定把这些环境的配置都写成博客记录下来. 今天就教 ...

  2. 如何在 Windows 上安装多个 MySQL,实现 MySQL 跨电脑移植使用

    如何在 Windows 上安装多个 MySQL,实现 MySQL 跨电脑移植使用 初次安装 MySQL 移植使用 附录 其它 MySQL 命令 查看本 MySQL 数据存放目录 MySQL 的各种其它 ...

  3. 如何在windows上搭建mysql_如何在Windows上安装多个MySQL

    [IT168 技术文档]本文以免安装版的mysql(Without installer)为例,对如何在Windows上安装多个MySQL进行讲解. 免安装版的mysql(Without install ...

  4. mongodb卸载_如何在Windows上安装MongoDB,启动,卸载

    mongodb卸载 Today we will learn how to install MongoDB on Windows. Most of us use Windows for our pers ...

  5. 如何在 Windows 上安装 ONLYOFFICE 文档 v7.2

    通过阅读本文,了解如何在Windows上安装ONLYOFFICE文档v7.2. 引言 使用社区版,您可以在本地服务器上安装 ONLYOFFICE 文档,并将在线编辑器与 ONLYOFFICE 协作平台 ...

  6. 如何在windows上安装虚拟机

    如何在windows上安装虚拟机 1.以win10为例子 2.下载虚拟机安装包 3.密钥激活 1.以win10为例子 2.下载虚拟机安装包 链接: https://my.vmware.com/web/ ...

  7. 如何在 Windows 上安装 ONLYOFFICE 文档 v7.3

    通过阅读本文,了解如何在 Windows 上安装 ONLYOFFICE 文档 v7.3. ONLYOFFICE 文档是什么 ONLYOFFICE 文档是一个在线办公套件,包括文本文档.电子表格和演示文 ...

  8. windows 安装php_如何在Windows上安装PHP

    windows 安装php We've previously shown you how to get a working local installation of Apache on your W ...

  9. python联想_联想电脑python安装教程_如何在windows上安装python

    如何在windows上安装python 方法如下: 首根据Windows版本(64位32位)从Python的官方网站下载Python 3.5的64装程序或32位安装程序. 然后,运行下载的EXE安装包 ...

最新文章

  1. golang中的fallthrough
  2. 大白话5分钟带你走进人工智能-第二十六节决策树系列之Cart回归树及其参数(5)...
  3. 世界是沙粒还是宇宙_看到一个沙粒世界:再一次你好世界
  4. 【Python】浮点数计算时的不准确性以及如何进行精确计算
  5. 【Python3网络爬虫开发实战】3.1-使用urllib
  6. python可以管理操作系统吗_python之路——操作系统的发展史
  7. docsys安装_DocSys文件系统部署
  8. frp ---- golang编写的内网穿透工具简介
  9. 常见面试算法:回归、岭回归、局部加权回归
  10. R语言绘制流程图(二)
  11. 一个超好用的笔记编辑器
  12. ubuntu系统下安装gcc
  13. 梦幻西游玩家最多的服务器,都说你是《梦幻西游》老玩家,这5个著名服务器你知道几个?...
  14. 如何为word增加页码,且第一页不显示页码?
  15. 东南计算机学硕专硕,2019考研报考注意这个专业学硕竟然不能调剂到专硕
  16. ubuntu18.04关闭笔记本触摸板
  17. 盘点最令人难忘的十大谍战剧经典
  18. 怎么将CAD图纸转换成高清晰度PNG格式怎么操作?
  19. 计算机通信原理知识点,《计算机通信原理与技术》.pdf
  20. Scrapy-Splash爬取淘宝排行榜(三)

热门文章

  1. Windows Mobile 获取来电号码和屏蔽来电
  2. lightbox的一个ajax效果
  3. 终极版Servlet——我只能提示您路过别错过
  4. Apache日志配置详解(rotatelogs LogFormat)
  5. 在github上保存vscode的配置(后续重新安装vscode时,可以十分方便地从github上下载安装这个保存的配置)...
  6. dataGridView相关问题
  7. servlet实现登陆注册
  8. 【转载】产品经理如何行之有效的提高执行力
  9. javascript 使用canvas绘画
  10. [翻译]NUnit---Explicit and Ignore Attributes(十二)