本文介绍了找不到命令-Oh-My-Zsh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Mac中安装了zsh和oh-my-zsh.现在,当我尝试从终端运行maven命令时,出现以下错误.

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

我已经在/Applications目录中安装了Apache maven.目前,我的.zshrc文件如下所示.

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

如上所示,我将maven安装的位置附加到了路径中.但是我仍然遇到错误.感谢您的帮助.

As seen above, I appended location of maven installation to the path. But I am still getting errors. Any help is appreciated.

推荐答案

问题:

➜ ~ mvn

zsh: command not found: mvn

step 1:

    vim ~/.zshrc

    vim ~/.zshrc

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

    source ~/.bash_profile;

    source ~/.bash_profile;

step 3:(Execution shell)

    > source ~/.bash_profile

    > source ~/.bash_profile

➜ / mvn

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

这篇关于找不到命令-Oh-My-Zsh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:38