Command not found - Oh-My-Zsh

Just add:

source ~/.bash_profile

to .zshrc


Try below steps:

Open terminal and run command vi ~/.zshrc

Add below lines in file:

export M2_HOME=/Users/<username>/Downloads/apache-maven-3.6.3 
export PATH=${M2_HOME}/bin:${PATH} 
export PATH

Save file successfully

Open another terminal instance & run command mvn -version

It should work!


I had a similar problem after installing oh-my-zsh, but for adb command. Looks like the PATH is shortened when oh-my-zsh is installed. I solved it using following steps.

  1. Open the .zshrc file

    sudo nano ~/.zshrc
    
  2. Look for # User configuration

    Un-comment the following line:

    export PATH="/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
    
  3. Save the file.

  4. source ~/.zshrc

Give this one a try for other similar command not found errors.


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... .......