Abdelrahman Rawag
Abdelrahman Rawag

Reputation: 21

How to add Maven to the Path variable windows 10?

Then I tried to add it to the path of Windows 10 as below:

Right click on my computer

Properties

Advanced System Setting

Environment Variable

New user variable and added Maven_Home with value:

C:\Users\Dell\Desktop\Selenium Course\apache-maven-3.8.1\bin

Add it to path variable with:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath;%MAVEN_HOME%\bin;

Open cmd and ask for mvn -version in desktop

CMD : 'mvn' is not recognized as an internal or external command, operable program or batch file.

Any help please

Upvotes: 2

Views: 6801

Answers (2)

Isuru Sandunika
Isuru Sandunika

Reputation: 1

Remove the bin from MAVEN_HOME. When the path is building you add bin again, then the path the machine is looking for is

C:\Program Files (x86)\Common Files\Oracle\Java\javapath;%MAVEN_HOME%\bin\bin;

which is wrong.

Upvotes: 0

André
André

Reputation: 2024

Inside System variables add:

  • Variable name: MAVEN_HOME
  • Variable value: \apache-maven-3.8.4

Then on your path add:

  • %MAVEN_HOME%\bin

Don't forget to restart your terminal. Then check if it's working with the command mvn -version.

Upvotes: 1

Related Questions