每次都要source /etc/profile才能使java环境生效,如何解决呢?

每次都要source /etc/profile才能使java环境生效,如何解决呢?
~/.bashrc里面加一句source /etc/profile 保存。并source /etc/profile 就可以了。

当然也有人说,不建议把环境变量写到profile里面,在/etc/profile.d/java.sh里面写入环境变量 

posted @ 2017-12-15 12:37  邓旭阳  阅读(2722)  评论(0)    收藏  举报