0

I am trying to launch maven project from command line but when i try using mvn --version or any other maven command it comes up with below error message

mvn is not recognized as internal or external command

DevT
  • 4,843
  • 16
  • 59
  • 92
Amruta
  • 41
  • 1
  • 5
  • 2
    Great. so install mvn :P – smk Mar 13 '13 at 05:24
  • Where is maven installed? Does PATH contain maven bin folder? – Raghuram Mar 13 '13 at 06:26
  • Maven is installed in my drive other than C and yes PATH contains maven bin folder – Amruta Mar 13 '13 at 06:40
  • you can refer this answer : [http://stackoverflow.com/questions/11890116/apache-maven-install-mvn-not-recognized-as-an-internal-or-external-command-a][1] [1]: http://stackoverflow.com/questions/11890116/apache-maven-install-mvn-not-recognized-as-an-internal-or-external-command-a – Reetika May 20 '14 at 10:49

3 Answers3

0

Maven is not installed in your OS. Please follow instructions from the following link http://maven.apache.org/download.cgi#Installation

Anoop George
  • 742
  • 6
  • 6
  • Maven is installed, i have set the environment variables properly too – Amruta Mar 13 '13 at 05:40
  • I have tried all the solutions given on stackoverflow tried moving user variables to system variable also changed MAVE_HOME to M2_HOME Nothing is working for me.I am using windows 7 Somebody please help me to fix this. – Amruta Mar 13 '13 at 06:26
0

Let's say you installed Maven to D:\tools\apache-maven-3.0.3 ...
then your system environment PATH needs to contain the string
D:\tools\apache-maven-3.0.3\bin
which should be separated from the other path entries using the path separator: ;

And, BTW, you don't need to set MAVEN_HOME or M2_HOME.
On my win7 system, I just put Maven's bin-folder on the path and set up a JAVA_HOME environment variable that points to an installation folder of a JDK ( e.g. D:\tools\jdk7u15 ), that's all.

Jörg
  • 2,434
  • 23
  • 37
  • The issue was fixed with a little trick..Actually i had installed some differnt version of jdk jre on my machine then also installed maven after that.But after sometime i found those jdk jre are not the correct on for my project so i deleted them,but i didn't removed environment variables of maven.After installation of newer jdk jre i was unable to use maven inside that so it was just a hit and try to removed environment variable of maven completly and add them again so it has luckily worked for me.. but i still didn't understand the logic behind that. – Amruta Mar 20 '13 at 11:46
0

just change M2 AND M2_HOME from user variables into system variables in advanced settings. it worked well with me.