java - macbook安裝maven失敗,-bash: mvn: command not found
問題描述
安裝maven時(shí)候報(bào)-bash: mvn: command not found,檢查了多個(gè)環(huán)境變量沒錯(cuò),現(xiàn)在不知如何解決問題
問題解答
回答1:/$M2_HOME/bin錯(cuò)了,應(yīng)該是$M2_HOME/bin
回答2:1、source .bash_profile
2、重新打開一個(gè)窗口
回答3:這是我的配置如下,你把路徑換成你的
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Homeexport PATH=$PATH:$JAVA_HOME/binexport M2_HOME=/Users/user/workspace/Tools/apache-maven-3.3.9export PATH=$PATH:$M2_HOME/bin
配完了,看你配在哪個(gè)文件(假如是/etc/profile),然后執(zhí)行
source /etc/profile回答4:
先
/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
然后
brew install maven
重啟下終端就可以了
