[英]Installing maven on windows 7 64bit
I want to create a Tapestry Skeletion Project. 我想创建一个Tapestry Skeletion项目。 I follow to these guide: http://maven.apache.org/download.html#Installation , http://juanjoefe.com/tutoriales/instalar-maven-en-windows-7/ and other guides on the internet.
我遵循这些指南: http : //maven.apache.org/download.html#Installation,http : //juanjoefe.com/tutoriales/instalar-maven-en-windows-7/以及互联网上的其他指南。
But, when I type "mvn --version" or "mvn -version", I always receive error " mvn
is not recognized as an internal or external command, operable program or batch file. 但是,当我键入“mvn --version”或“mvn -version”时,我总是收到错误“
mvn
未被识别为内部或外部命令,可操作程序或批处理文件。
My friends use Windows 7 x86, and they had no problem. 我的朋友使用Windows 7 x86,他们没有问题。 How can I install Maven 3.0.3 on Windows 7 x64?
如何在Windows 7 x64上安装Maven 3.0.3?
Yucca 丝兰
Setting up Maven 3.0.4 in Windows 7 64 bit 在Windows 7 64位中设置Maven 3.0.4
Right Click My Computer --> Properties --> Advanced System Properties --> Environment Variables --> System Variables 右键单击我的电脑 - >属性 - >高级系统属性 - >环境变量 - >系统变量
Click New 单击新建
Add 加
M2_HOME=C:\maven\apache-maven-3.0.4
M2=%M2_HOME%\bin
Assuming JAVA_HOME is already setup. 假设已经设置了JAVA_HOME。
Edit Path environment Variable and add %M2%
as ;%M2%
at the end of the existing path 编辑路径环境变量并将
%M2%
添加为现有路径末尾的;%M2%
example: 例:
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%
Apply and Close the System Properties 应用并关闭系统属性
Open a new command prompt and type 打开一个新的命令提示符并键入
mvn --version mvn --version
Following will be the message, 以下将是消息,
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"
I had the same issue but was able to fix it. 我有同样的问题,但能够解决它。
When I set up maven_home
, I had a semi-colon ;
当我建立
maven_home
,我有一个分号;
at the end. 在末尾。 So when I set up path it become
MAVEN;\\bin ...
. 因此,当我设置路径时,它变为
MAVEN;\\bin ...
I removed the semi-colon ;
我取下了分号
;
at the end and problem solved. 最后,问题解决了。
For some reason the ;
出于某种原因
;
does not matter in Windows XP, but is a problem in Windows7 (32 bit). 在Windows XP中无关紧要,但在Windows7(32位)中是一个问题。
Nathan 弥敦道
You can also have multiple Maven installations in your PATH like I do: 您也可以像我一样在PATH中安装多个Maven:
C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\glassfish3\jdk7\bin;C:\DEV\servers\apache-tomcat-7.0.5\bin;C:\Program Files (x86)\Java\jdk1.6.0_25\bin;C:\DEV\apache-maven-3.0.3\bin;C:\DEV\apache-maven-2.2.1\bin;C:\Program Files (x86)\Windows Live\Shared
The first Maven bin (Maven 3), is used before my previous (Maven 2). 第一个Maven bin(Maven 3)在我之前使用过(Maven 2)。
Windows sort all variables by alphabet. Windows按字母顺序排序所有变量。 Don't use multiple elements to construct path to maven like M2 for folder /bin and M2_HOME for root folder JUST take full path to \\bin directory of maven and put it in the Path variable
不要使用多个元素来构建maven的路径,例如M2用于文件夹/ bin,而M2_HOME用于根文件夹JUST将完整路径连接到maven的\\ bin目录并将其放在Path变量中
您必须将包含mvn可执行文件的目录添加到PATH环境变量中。
I faced with this problem when use maven 3.3.3. 我在使用maven 3.3.3时遇到了这个问题。 Then tried with maven 3.3.9, it worked!
然后尝试使用maven 3.3.9,它工作了! Solution is download new version of maven.
解决方案是下载maven的新版本。
Solved my issue by doing the following: 通过执行以下操作解决了我的问题:
As per Maven [Install] section page, It says: "Extract distribution archive in any directory". 根据Maven [Install]部分页面,它说:“在任何目录中提取分发存档”。 So extracted files in G: drive and hence this was the cause root.
因此在G:驱动器中提取文件,因此这是根本原因。
Shifted the downloaded folder to C: drive solved my issue 将下载的文件夹移至C:驱动器解决了我的问题
Updated environment variables. 更新了环境变量。 Closed and re-open the command prompt.
关闭并重新打开命令提示符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.