1、打开终端输入: sudo vi /etc/paths 2、让操作立即生效: source ~/.bash_profile end hint:输入环境变量时,不用一个一个地输入,只要拖动文件夹到 Terminal 里就可以了。