configuration file and execution order:
1>/etc/profile, System level, will call/ETC/BASH.BASHRC
2>/etc/enviroment, System level, setting system-level environment variables
3> ~/.profile, user-level
4> ~/.BASHRC, User level
5> ~/.bash_profile or ~./bash_login-if One of these file exist, bash executes it rather then ' ~/.profile ' when it is s tarted as a login shell. (Bash would prefer "~/.bash_profile" to "~/.bash_login"). However, these files won ' t influence a graphical session by default.
Configuration method:
Export path= "$PATH:/my_new_path"
The Java environment switches from Openjava to Oracl Java, in addition to setting environment variables, you need to do the following:
1> marking a new Java environment
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> Select the ID of 300
sudo update-alternatives--config java
sudo update-alternatives--config JavaC
Linux environment variable Configuration