Java – mvn is not recognized as an internal or external command

javamavenmaven-2maven-3

I followed all the tutorials and tried to use maven.

I run win 7, and downloaded maven 3.5.4.

  1. I placed the zip file under c:\Maven and extract it in that location.

  2. I navigate to Environment variables and create Variable M2, and put value %M2_HOME%\bin.

  3. I navigate to Environment variables and create Variable M2_HOME and put value C:\Maven\apache-maven-3.5.4

  4. I navigate to System variables and in Path I added %M2_HOME%\bin

  5. In System variables the variable JAVA_Home has value C:\Program Files\Java\jdk1.8.0_65

What am I missing?

[maven path][maven path]

[java path][java path]

[env variable][env variable]

[system variable ][system variable]

[java home][java home]

[echo ][command line]

[maven path][maven path]

Best Answer

When using Windows, I prefer to install with chocolatey.org You can put Java, mvn, etc on your machine and forget about it. Similar to the package management system in Linux