Environment variables under Mac system:
a. /etc/profile
b. /etc/paths
c. ~/.bash_profile
d. ~/.bash_login
e. ~/.profile
f. ~/.bashrc
Among them, a and b are system-level files, so do not easily modify the
c, d, and e files and execute them in the order from front to back. If one of the files exists, the latter will not be executed.
Usually, the configuration of jdk and maven is configured in c.
If the configuration takes effect for the first time, but it fails after restarting the terminal, it may be the cause of zsh.
Create a file ~/.zshrc and add
it in it:
source ~/.bash_profile
Note that there export PATH=
can only be one, if there are multiple, they can be separated by colons, and this command must be at the bottom