I recently installed zsh and oh-my-zsh in my Mac. Now when I try to run a maven command from the terminal, I am getting the following error.
$ mvn install zs
As mentioned by @4ae1e1 in his comment, $ have to be added before M2_HOME while referring it in the PATH variable, as follows:
$
M2_HOME
PATH
export M2_HOME=/Applications/apache-maven-3.3.3 export PATH=$PATH:$M2_HOME/bin/
Once added, as others suggested, source the ~/.zshrc file.
~/.zshrc