1

I installed maven in /Users/chenmin/software/apache-maven-3.6.3, and when I type cat ~/.bash_profile, it returns:

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

and /Users/chenmin/software/apache-maven-3.6.3/bin is also included in the variable $PATH. However, everytime I open a new command window and type a mvn command (e.g. mvn clean install), it suggests zsh: command not found: mvn, and when I type source ~/.bash_profile, the command could be executed correctly, even though I had not modify the file ~/.bash_profile, can anyone answer why?

hata
  • 11,633
  • 6
  • 46
  • 69
Min Chen
  • 75
  • 1
  • 6
  • @MinChen : If you want to see your PATH, it is pointless to `cat` any file. I would simply do a `echo $PATH` or `echo $path[*]`. Finally, I don't understand why you are tagging your post with `zsh`, but fiddle around with a bash startup file. Please make up your mind whether we are talking bash or zsh. – user1934428 Mar 22 '21 at 14:38

1 Answers1

0

If you are using zsh now, you may have to use ~/.zshrc rather than the ~/.bash_profile.

hata
  • 11,633
  • 6
  • 46
  • 69