下载maven的bin,在apache官方网站可以下载。
配置Maven环境变量。在环境变量中新建变量名:“M2_HOME”。变量值为“D:/apache-maven-3.2.3”。
在PATH变量中添加配置信息"%M2_HOME%/bin"。
注:前提是PATH中已经配置JAVA的环境变量、以及JAVA_HOME的环境变量。否则就会报错如下:
Error: JAVA_HOME not found in your environment.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
WIN+R,输入CMD,点击确定。执行命令"mvn -version",如果出现如下信息,则表示配置成功。
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:1
0+08:00)
Maven home: D:/apache-maven-3.2.3
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: D:/Program Files/Java/jdk1.7.0_45/jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
网友评论