[英]mvn is not recognized after installation Maven 3
I have some problems with my maven 3 installation. 我的maven 3安装有一些问题。
I have downloaded maven 3.0.3 and extracted it to a folder. 我已经下载了maven 3.0.3并将其解压缩到一个文件夹中。 I set the following environment variables.
我设置了以下环境变量。
C:\\a few folders\\apache-maven-3.0.3
%M2_HOME%\\bin
C:\\Program Files\\Java\\jdk1.6.0_25
%JAVA_HOME%\\bin; %M2%
I get a message that the command is not recognized when i type "mvn" in the command line. 我收到一条消息,当我在命令行中输入“mvn”时,无法识别该命令。 Any ideas?
有任何想法吗?
Maven 3.0.3 and later doesn't need the M2_HOME
variable. Maven 3.0.3及更高版本不需要
M2_HOME
变量。 The following environment variable changes are sufficient to run Maven from the command-line: 以下环境变量更改足以从命令行运行Maven:
JAVA_HOME
to the Java jdk
directory (eg. C:\\Program Files\\Java\\jdk1.6.0_29
) JAVA_HOME
为Java jdk
目录(例如, C:\\Program Files\\Java\\jdk1.6.0_29
) PATH
to include the Maven bin
directory. PATH
设置为包含Maven bin
目录。 Everything looks OK. 一切都很好看。
%M2%
. %M2%
之后是否应该有空格。 This might be your problem. Try this: 试试这个:
Add(create) these new variables at the SYSTEM VARIABLES (M3_HOME and M3): 在SYSTEM VARIABLES(M3_HOME和M3)中添加(创建)这些新变量:
M3_HOME: C:\maven_installation_folder\
M3: %M3_HOME%\bin
Include at: "CLASSPATH" and "Path" variables 包含在:“CLASSPATH”和“Path”变量
CLASSPATH: other_variables;%M3%;
Path: other_variables;%M3%;
Go to Command Prompt (cmd) and type: 转到命令提示符(cmd)并键入:
mvn -version
Maven 3.0.3 and later doesn't need the M2_HOME variable. Maven 3.0.3及更高版本不需要M2_HOME变量。 So no need to add that.
所以不需要添加它。
I did the following in the Windows System variables and it works: 我在Windows系统变量中执行了以下操作,它可以工作:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_31
Path=C:\Program Files\Java\jdk1.8.0_31\bin;C:\Selenium 3\Maven\apache-maven-3.3.3\bin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.