Issue
I try to understand what is the problem for git bash: mvn: command not found
I set path in this way:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%M2_HOME%\bin;C:\Program Files\Git\cmd;export PATH=$PATH:/c/Program\ Files/Java/jdk1.8.0_281/bin:/c/Program\ Files/apache-maven-3.8.1/bin
I check with cmd Maven and Java and seems to be ok
Solution
Solution by khmarbaise
I removed M2_HOME, MAVEN_HOME and I change path in this way
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%M2_HOME%\bin;C:\Program Files\Git\cmd;C:\Program Files\apache-maven-3.8.1\bin;
I retype mvn --version
and works correctly
Answered By - Alex Doc
Answer Checked By - Candace Johnson (JavaFixing Volunteer)