By Marcel M.

2017-05-07 10:57:06 8 Comments

I just installed Maven and added the \bin directory of maven to my path variables. When I try to use the mvn command in the Command Prompt I just get a message:

mvn: command not found

Everything else I found on here did not help yet.


I used to install maven.

SET PATH=%PATH%;C:\Program Files\Maven\apache-maven-3.5.0\bin\mvn.cmd


@J Slick 2019-09-30 19:33:01

This is my working maven configuration on Windows 10. Was more cumbersome to configure on W10 than on WXP or W7.

enter image description here

@rene 2017-05-07 11:28:04

You have included the file in the path:

C:\Program Files\Maven\apache-maven-3.5.0\bin\mvn.cmd

That is not good. The PATH environment variable should only include a path to where files, like exe and cmd's can be found.

Adapt your PATH to read like this:

C:\Program Files\Maven\apache-maven-3.5.0\bin

(so remove the \mvn.cmd). Make sure to start a new command prompt to verify if your path settings are correct.

See How can I set user environmental variables (such as PATH) from a non-administrator account on Windows 7 to find the correct Windows dialog to adapt the settings among many more.

@Junior M 2017-08-12 18:59:37

Following this tutorial by mkyong, I was able to get this to work on Windows 10 (v10.0.15063):

  1. Install JDK and setup JAVA_HOME system variable

  2. Download Maven zip, extract it and setup M2_HOME and MAVEN_HOME system variables to point to root maven folder (without \bin)

  3. Update PATH system variable to include %M2_HOME%\bin (this is what will let you run "mvn" in Command Prompt).

  4. Open Command Prompt (cmd.exe) and execute mvn -version

You can download Maven ( here, if you don't have it already.

The Java SDK (jdk-8u144-windows-x64.exe) can be downloaded from Oracle here.

Related Questions

Sponsored Content

15 Answered Questions

[SOLVED] Python not working in the command line of git bash

33 Answered Questions

[SOLVED] How can I set up an editor to work with Git on Windows?

5 Answered Questions

[SOLVED] mvn command not found in OSX Mavrerick

44 Answered Questions

5 Answered Questions

[SOLVED] How do you specify the Java compiler version in a pom.xml file?

  • 2013-05-23 20:42:06
  • MTT
  • 286528 View
  • 249 Score
  • 5 Answer
  • Tags:   java maven pom.xml

19 Answered Questions

[SOLVED] Adding Python Path on Windows 7

2 Answered Questions

getting error during using command "mvn" in cmd after set the class path for maven

  • 2016-10-15 08:38:32
  • chinmaya
  • 43 View
  • 0 Score
  • 2 Answer
  • Tags:   java maven

1 Answered Questions

[SOLVED] mvn works in cmd prompt but not in batch

1 Answered Questions

[SOLVED] Can't run mvn --version

  • 2013-09-23 19:28:13
  • user1477388
  • 1788 View
  • 0 Score
  • 1 Answer
  • Tags:   java maven maven-3

Sponsored Content