在 Windows 7 64 位中设置 Maven 3.0.4
M2_HOME=C:\maven\apache-maven-3.0.4
M2=%M2_HOME%\bin
假设已设置。JAVA_HOME
- 编辑环境变量并添加为在现有
Path
%M2%
;%M2%
path
例:
C:\Users\arun.bc\oraclexe\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\DW WLAN Card;C:\Ruby193\bin;C:\Borland\BCC55\Bin;%JAVA_HOME%/bin;%M2%
应用并关闭系统属性
打开新的命令提示符并键入
mvn --version
应显示以下消息:
C:\Users\arun.bc>mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 16:44:56+0800)
Maven home: C:\maven\apache-maven-3.0.4
Java version: 1.7.0_03, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_03\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"