TheRealRave
TheRealRave

Reputation: 373

What is the step-by-step approach to solving: 'mvn' is not recognized as an internal or external command, operable program or batch file

I'm a rookie when it comes to Windows. I have installed Apache Maven by following the instructions in the given read me.

What I did was unzip the download and then set PATH="c:\program files\apache-maven-3.3.9\bin"

I then typed mvn --version into the command prompt and then I got the error; 'mvn' is not recognized as an internal or external command, operable program or batch file..

I have read various answers to this problem. Many people have solved it by moving the M2 and M2_HOME from user variables to system variables.

The problem is that I am getting confused by this. Can someone provide me with step-by-step instructions on how to solve this?

Upvotes: 0

Views: 611

Answers (1)

Sanjeev Saha
Sanjeev Saha

Reputation: 2652

Step 1: Unzip maven apache-maven-3.3.3-bin.zip to a location on system say C:\Program Files. So we have a directory structure as:

enter image description here

Step 2: Set an environment variable (system variable) M2_HOME=C:\Program Files\apache-maven-3.3.3

enter image description here

Step 3: Edit the PATH variable (system variable) of your system. Add %M2_HOME%\bin; at the beginning of your PATH variable and click OK.

enter image description here

Step 4: Run mvn -version from command prompt.

enter image description here

Hope, this helps.

Upvotes: 1

Related Questions