MVN is not recognised as internal or external command. UPDATE: JAVA_HOME is not defined is error now in cmd

98 Views Asked by At

Whenever I type mvn -version to check version installed it says that "mvn is not an internal or external command" in cmd.

I have added images to show that I have added environmental variable and the path. do check those and help out.

UPDATE :

After having been told that i have to remove \bin from environment variable of both JAVA_HOME and MAVEN_HOME. now I'm getting error in cmd as JAVA_HOME is not defined.

Environmental variable image

environmental variable image

Path Image

path image

Cmd Image

cmd image

1

There are 1 best solutions below

7
On

Your MVN_HOME should be the maven root folder (G:\compressed\apache-maven-3.8.4) not up to the bin folder.

Change MVN_HOME variable to G:\compressed\apache-maven-3.8.4 then open a new cmd prompt then the command will work.