java - macbook failed to install maven, -bash: mvn: command not found
習慣沉默
習慣沉默 2017-05-27 17:41:45
0
4
892

When installing maven, it reported -bash: mvn: command not found. I checked multiple environment variables and it was correct. Now I don’t know how to solve the problem

習慣沉默
習慣沉默

reply all(4)
滿天的星座

/$M2_HOME/bin错了,应该是$M2_HOME/bin

黄舟

1. source .bash_profile

2. Reopen a window

过去多啦不再A梦

This is my configuration as follows, you can change the path to yours

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin

export M2_HOME=/Users/user/workspace/Tools/apache-maven-3.3.9
export PATH=$PATH:$M2_HOME/bin

After configuration is completed, check which file you configured it in (if it is /etc/profile), and then execute

source /etc/profile
某草草

First

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then

brew install maven

Just restart the terminal and it’s done

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template