首页 > 系统服务 > 详细

Linux 环境变量配置

时间:2017-09-22 12:36:36      阅读:237      评论:0      收藏:0      [点我收藏+]

配置文件及执行顺序:

1> /etc/profile,系统级,会调用 /etc/bash.bashrc

2> /etc/enviroment,系统级,设置系统级环境变量

3> ~/.profile, 用户级

4> ~/.bashrc,用户级别

5> ~/.bash_profile or ~./bash_login- If one of these file exist, bash executes it rather then "~/.profile" when it is started as a login shell. (Bash will prefer "~/.bash_profile" to "~/.bash_login"). However, these files won‘t influence a graphical session by default.

配置方法:

export PATH="$PATH:/my_new_path"

 

Java 环境从openJava 切换到oracl Java,除设置环境变量外,需进行以下操作:

1>  标记新的Java环境

sudo update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 300

sudo update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 300

2> 选择标识为300的

sudo update-alternatives --config java

sudo update-alternatives --config javaC

 

Linux 环境变量配置

原文:http://www.cnblogs.com/JLea/p/7574159.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!