error
lanweipeng@192 ~ % mvn -v
/usr/local/maven/bin/mvn: line 45: uname: command not found
/usr/local/maven/bin/mvn: line 66: dirname: command not found
错误: 找不到或无法加载主类 org.codehaus.plexus.classworlds.launcher.Launcher
my conf
M2_HOME=/usr/local/maven
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
export PATH="$JAVA_HOME/bin"
export PATH="$M2_HOME/bin"
#export PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export CLASSPATH
本人用的是mac系统。
export PATH="$JAVA_HOME/bin"
export PATH="$M2_HOME/bin"
这两行有问题,你相当于把 PATH 变量重新赋值了而不是追加,把这两行删了,在最后面加上下面这行就行了
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
PS:记得修改PATH值时,都要带上原有的PATH