Command not found - Oh-My-Zsh

前端 未结 12 910
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-25 11:54

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         


        
相关标签:
12条回答
  • 2020-12-25 12:46

    Just add:

    source ~/.bash_profile
    

    to .zshrc

    0 讨论(0)
  • 2020-12-25 12:47

    step 1:

    vim ~/.zshrc
    

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

    source ~/.bash_profile;
    

    step 3 : (Save changes in Vim)

     :wq!
    

    step 4:(Execution shell)

    > source ~/.bash_profile
    
    0 讨论(0)
  • 2020-12-25 12:49

    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!

    0 讨论(0)
  • 2020-12-25 12:50

    Combining other answers I got adb working on mac and zsh appending these two path lines to .zshrc:

    # If you come from bash you might have to change your $PATH.
    # export PATH=$HOME/bin:/usr/local/bin:$PATH
    # this are for Android Studio adb:
    export PATH=~/Android/sdk/tools:$PATH
    export PATH=~/Android/sdk/platform-tools:$PATH
    
    0 讨论(0)
  • 2020-12-25 12:52

    copy this thing into your .zshrc file :

    export PATH=$PATH:/Applications/apache-maven/bin
    
    0 讨论(0)
  • 2020-12-25 12:53

    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.

    0 讨论(0)
提交回复
热议问题