windows 7 maven 2 安装 [英] windows 7 maven 2 install

查看:33
本文介绍了windows 7 maven 2 安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将完成一本书,Flex on Java",它要求我安装 maven 2+,我从 apache 站点下载了 maven.补充:

I'm about to work through a book, "Flex on Java" and it's asked me to install maven 2+ i downloaded maven from the apache site. Added :

M2_HOME = C:apache-maven-2.2.1

M2 = %M2_HOME%in

根据 http://maven.apache.org/download 的说明转到环境变量.html然后它到达数字 6,上面写着在同一个对话框中,在用户变量中更新/创建 Path 环境变量,并在值前添加 %M2% 以添加命令行中可用的 Maven."

to the environment vars according to the instructions at http://maven.apache.org/download.html then it gets to number 6 which says "In the same dialog, update/create the Path environment variable in the user variables and prepend the value %M2% to add Maven available in the command line."

我应该编辑哪个环境变量并将 %M2% 添加到?

Which environment variable should i edit and add %M2% to?

谷歌搜索后,我发现了一个帖子,上面写着附加",而不是添加到 JAVA_HOME 的值之前我已经尝试将其添加到 java home var 但是当我尝试这样做时来自命令行的 mvn 命令,它说它无法识别.

After googling i found a post which says "append", not prepend to the value of JAVA_HOME I've tried prepending and appending it to the java home var but when i try to do an mvn command from the command line it says its not recognised.

以前从未使用过 maven,所以这是我的第一次设置.谁能看到我做错了什么或者我还需要做什么才能使用 mvn 命令,谢谢.

Never used maven before so this is my first set up. Can anyone see what i'm not doing right or what else i need to do to be able to use the mvn command, please and thank you.

推荐答案

你应该编辑的环境变量是path.

The environment variable you should edit is path.

Windows 7 上的路由是:

The route on Windows 7 is:

控制面板->系统->高级系统设置->高级选项卡->环境变量->path变量就在系统变量s 区域

path 变量指定一组目录和/或 Windows 搜索命令定义的路径.您应该在此变量值的末尾附加值 ;%M2% (注意分号,不同的路径应该用它们分隔),以便 Windows能够找到 Maven 命令定义.

The path variable specifies a group of directories and/or paths that Windows searches for commands definitions. You should append to the end of this variable value the value ;%M2% (note the semi-colon, different paths should be separated by them) in order for Windows to be able to find the Maven command definitions.

在路径环境变量末尾追加;%M2与追加;C:apache-maven-2.2.1in

Appending ;%M2 at the end of the path environment variables is the same as appending ;C:apache-maven-2.2.1in

要测试一切是否正常,请键入 mvn --version,如果一切正常,那么您正在使用的当前 Maven 版本应该会显示在屏幕上.

To test that everything is ok, type mvn --version, if everything is right then the current Maven version you're using should be displayed on the screen.

这篇关于windows 7 maven 2 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆