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?