Mac命令行:zsh:找不到命令:mvn



我在/Users/chenmin/software/apache-maven-3.6.3中安装了maven,当我键入cat ~/.bash_profile时,它返回:

export PATH=$PATH:/Users/chenmin/software/apache-maven-3.6.3/bin
export PATH=${PATH}:/usr/local/mysql/bin
export PATH=${PATH}:/usr/local/mysql/support-files
export PATH=$PATH:/Users/chenmin/software/apache-tomcat-8.5.58/bin
export PATH=$PATH:/Users/chenmin/software/apache-tomcat-8.5.58/logs
export PATH=$PATH:/Users/chenmin/software/redis/6.0.9/bin
export PATH=$PATH:/Users/chenmin/software/rabbitmq
export PATH=$PATH:/usr/local/sbin

并且CCD_ 3也包括在变量CCD_。然而,每次我打开一个新的命令窗口并键入mvn命令(例如mvn clean install(时,它都会建议zsh: command not found: mvn,而当我键入source ~/.bash_profile时,该命令可以正确执行,即使我没有修改文件~/.bash_profile,有人能回答为什么吗?

如果您现在使用zsh,您可能必须使用~/.zshrc而不是~/.bash_profile

最新更新