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

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

问题描述

我将要通过一本书,Flex的Java,并要求我安装maven 2+我从apache站点下载了maven。
添加:

  M2_HOME = C:\apache-maven-2.2.1 

  M2 =根据  

//maven.apache.org/download.htmlrel =nofollow noreferrer> http://maven.apache.org/download.html
然后它到6号,说
在同一个对话框中,更新/创建用户变量中的Path环境变量,并添加值%M2%以在命令行中添加可用的Maven。 / p>

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



googling之后,我发现一个帖子说append,而不是前缀 JAVA_HOME
的价值我已经尝试过将其附加到java home var,但是当我尝试从命令行做
一个mvn命令时,它表示它不被识别。



从未使用过maven befo所以这是我的第一个设置。任何人都可以看到我正在做的不正确,还有什么我需要做的才能使用mvn命令,谢谢。

解决方案

您应该编辑的环境变量是路径



Windows 7上的路由是:



控制面板 - >系统 - >高级系统设置 - >高级选项卡 - >环境变量 - > 路径变量位于系统变量区域



路径变量指定Windows搜索命令定义的一组目录和/或路径。您应该附加到此变量值的结尾值;%M2% note 分号,不同的路径应由它们分隔),以便Windows能够找到Maven命令定义。



在最后添加;%M2 路径环境变量与追加相同; C:\apache-maven-2.2.1\bin



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

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

and

M2 = %M2_HOME%\bin

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."

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

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.

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.

解决方案

The environment variable you should edit is path.

The route on Windows 7 is:

Control Panel -> System -> Advanced system settings -> Advanced Tab -> Environment Variables -> The path variable is right on the system variables area

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.

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

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天全站免登陆