I get the following error when I type the command mvn --version
:
'mvn' is not recognized as an internal or external command, operable program or batch file.
I have also followed this but still I am unable to get the work done.
when I type this command echo %M2_HOME%
I get path printed as D:\Program Files\apache-maven-3.0.4
when I type 'echo %M2%' I get the path printed as D:\Program Files\apache-maven-3.0.4\bin
Environment : Windows XP
The mvn executable has to be added to your PATH variable. Alternatively you can try starting mvn from its bin-directory as a first test.
Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=/usr/java/jdk1. 5.0_02 and that $JAVA_HOME/bin is in your PATH environment variable. Run mvn --version to verify that it is correctly installed.
Once Maven is installed, you can check the version by running mvn -v from the command-line. If Maven has been installed, you should see something resembling the following output. If you see this output, you know that Maven is available and ready to be used.
On my Windows 7 machine I have the following environment variables:
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07
M2_HOME=C:\apache-maven-3.0.3
On my PATH
variable, I have (among others) the following:
I tried doing what you've done with %M2%
having the nested %M2_HOME%
and it also works.
Make sure you have your maven bin directory in the path and the JAVA_HOME property set
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With