Home > Enterprise >  I m receiving error "'mvn' is not recognized as an internal or external command, oper
I m receiving error "'mvn' is not recognized as an internal or external command, oper

Time:12-10

Kindly help with this issue:

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

I tried to delete environment variables and path variable created and restart the system and recreate and ran mvn -version ... still the same error .

CodePudding user response:

Restart pc, after setting up your M2_HOME (pointing to your Maven-based dir, NOT the bin dir) and PATH (PATH=%M2_HOME%\bin;%PATH%)

dir %M2_HOME%\bin\mvn*

Right-click on My Computer >> Properties >> Advanced system settings >> System Properties window will get displayed Under Advanced >> Environment Variables

  • Click on New to set Environment Variables

    Variable name: JAVA_HOME Variable value: C:\Program Files\Java\jdk1.8.0_121

    Variable name: M2 Variable value: %M2_HOME%\bin

    Variable name: M2_HOME Variable value: C:\Program Files\Apache Software Foundation\apache-maven-3.5.0

    Variable name: Path Variable value: %M2_HOME%\bin

Then click on Ok, ok, ok. Now restart your command prompt and check again with “MVN –version” to verify the MVN is running, you may restart your system also.

CodePudding user response:

I have successfully configured it after a long battle. Thank you!

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: C:\SELENIUM\DMT-Build tool-MAVEN\apache-maven-3.8.6-bin\apache-maven-3.8.6 Java version: 1.8.0_202, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_202\jre Default locale: en_IN, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

  • Related