Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command not found - Oh-My-Zsh

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.

like image 779
Pattu Avatar asked Nov 26 '15 09:11

Pattu


People also ask

How do I enable zsh on my Mac?

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.


2 Answers

Question:

➜ ~ mvn

zsh: command not found: mvn

Answer:

step 1:

    vim ~/.zshrc

step 2:(Add at the end of the file)

    source ~/.bash_profile;

step 3:(Execution shell)

    > source ~/.bash_profile

You can use mvn :

➜ / mvn

[INFO] Scanning for projects... .......

like image 189
sunmeilinbbs Avatar answered Sep 29 '22 01:09

sunmeilinbbs


Just add:

source ~/.bash_profile 

to .zshrc

like image 23
Vítor Marçal Avatar answered Sep 29 '22 01:09

Vítor Marçal