简体   繁体   中英

Problems with maven installation

Hi I'm trying to install MAVEN , to my computer using this tutorial, I've set my enviroment variable MAVEN_HOME to point to my maven directory, and I put value of path_to_maven/bin inside another enviroment variable named Path and I get this error message:

C:\>mvn -version
'mvn' is not recognized as an in
operable program or batch file.

I've tried also to use PATH instead of Path but that doesn't solve it, what else can I do? I'm using windows 7..

Go to path_to_maven/bin and type mvn -version . If that works then it's a PATH problem.
In MS-DOS's prompt type set PATH=path_to_maven/bin;%PATH%

您可能需要重新启动计算机才能使对PATH的更改生效。

If it helps someone:

Try to add the entire directory path in the PATH variable instead of using the referrals like %M2% .

I had a similar problem while configuring maven.

I've installed Maven 2 on my computer and I had problems when invoking mvn --version from cmd.

I've set the M2_HOME and M2_REPO environment variables and I have added to the system variable PATH the path_to_maven/bin.

In order to be able to invoke mvn from cmd I had to add still another environment variable named PATH with value path_to_maven/bin.

I hope this will help anyone caught in this issue.

Close the Command Prompt and then re-open it again. Hit the command mvn -version . It should work if the environment/system variables are set properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM