Reputation: 5216
I have read similar questions about this problem but it is not working anyways.
I've extracted maven 3.3.3 to D:\Maven (Java already installed and works fine) then added 2 system variables:
Variable | Value |
---|---|
M2 |
%M2_HOME%\bin |
M2_HOME |
D:\Maven |
I've also appended next in the path:
%M2%
But it is still not working.
I can execute mvn -version
from the D:\Maven\bin
but can't do this from another directory.
Upvotes: 3
Views: 43928
Reputation: 189
One mistake I did was, There will two environment variables section
One can be accessed via admin while the other one doesn't require any. Please specify the paths in the second place
It will work for sure., also try echo %M2_HOME%
to check whether you have configured correctly..before jumping to mvn install
Hope this helps for someone who has to use admin rights
Upvotes: 0
Reputation: 276
Try to put full maven path upto bin like "C:\Users\ABC\Downloads\maven-2.0.5-bin\maven-2.0.5\bin" directly into path variable of os, then you will be able to understand where problem exists.
Upvotes: 0
Reputation: 3056
Don't put extra space in your path after D:\Maven\bin; in D:\Maven\bin; D:\Program Files\NodeJS; Please don't make any space in path variable.
Normally, To set mvn in command line in windows :
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
M2_HOME=D:\apache-maven-3.3.3
Finally add maven to PATH
;%M2_HOME%\bin;
add this at the end of PATH property of system environment
Now Try mvn -version
Upvotes: 8