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 zsh: command not found: mvn
I have installed Apache maven in /Applications directory. Currently my .zshrc file looks like below.
plugins=(git brew pip mvn mysql-macports python sublime tmux osx) # #################### # Maven Config Options # #################### export M2_HOME=/Applications/apache-maven-3.3.3 export PATH=$PATH:M2_HOME/bin
As seen above, I appended location of maven installation to the path. But I am still getting errors. Any help is appreciated.
Hold the Ctrl key, click your user account's name in the left pane, and select “Advanced Options.” Click the “Login Shell” dropdown box and select “/bin/bash” to use Bash as your default shell or “/bin/zsh” to use Zsh as your default shell. Click “OK” to save your changes.
➜ ~ mvn
zsh: command not found: mvn
step 1:
vim ~/.zshrc
step 2:(Add at the end of the file)
source ~/.bash_profile;
step 3:(Execution shell)
> source ~/.bash_profile
➜ / mvn
[INFO] Scanning for projects...
.......
Just add:
source ~/.bash_profile
to .zshrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With