在ubuntu上安装jdk的时候 发现在/etc/profile中配置环境变量以后,每次重新打开一个终端就必须source /etc/profile 才能生效,并不是只使用一次source /etc/profile,网上查了查,是还需要配置另外一个文件
https://www.cnblogs.com/hwh000/p/13683368.html
方法一:
在 ~/.bashrc 里面加一句 source /etc/profile ,然后执行一次 source ~/.bashrc 使该文件生效即可。
方法二:
直接将配置语句写在 ~/.bashrc 里面,然后执行一次 source ~/.bashrc 使该文件生效即可。