macOS -- Maven environment variable do not take effect

332 Views Asked by At

I'm using zsh as my terminal and trying to install maven, After I tried to set environment variables, the mvn command still prompted:

zsh: command not found: mvn

I added the following code in my .zshrc file

export MAVEN_HOME=/Library/Maven
export PATH=$PATH:$MAVEN_HOME/bin

When I execute

echo $MAVEN_HOME

it shows the variable address exactly. But when I execute

echo $PATH

There is no address for Maven in PATH

0

There are 0 best solutions below