Configure maven,mvn: command not found? under mac


JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home 
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export M2_HOME="/Applications/apache-maven-3.5.3" 
export PATH="$M2_HOME/bin:$PATH" 
export JAVA_HOME
export PATH
export CLASSPATH
Mar.14,2021

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
M2_HOME=/Applications/apache-maven-3.5.3
PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export M2_HOME
export JAVA_HOME
export PATH
export CLASSPATH
Why not write this way, it has not been matched on MAC, it is just a guess.


the first method has been given on the first floor. The second method, brew install maven, and the third method, sdk install maven.


mac is better to use the package manager. Like homebrew. Just one command for anything

Menu