When Ubuntu 12.04 is started, the environment variable loading sequence is used to figure out the startup sequence of various environment variable scripts in Linux. It is of great help to make good use of Linux to solve various strange errors that cannot find dependent files. The environment variable loading process at startup in Ubuntu is roughly:/etc/enviroment/etc/profile -->/etc/bash. bashrc -->/etc/profile. all. sh file ~ /. Profile (or ~ /. Bash_profile or ~ /. Bash_login) --> ~ /. Bashrc (if bash is run) --> ~ /. Bash_aliases -->/etc/bash_completion the first two are system environment variables, and the last is the local environment variables of the current user. /Etc/enviroment is called first after some core components of the system are loaded. Many peripheral Programs depend on it to run. If there is any problem, the system may fail to start normally. As a result, the system-level public environment variable/etc/profile is first executed when the login environment is started. Equivalent to the application-level public environment variable ~ /. Profile: when the shell is opened, others/etc/profile is executed. Pay attention to application-level user environment variables ~ /. Profile is executed when the shell is opened. That is to say, if the environment variables configured in the script or the script it will call (generally. bashrc) are invalid in the graphic interface! If you want to configure an environment variable that is still valid in the graphic interface, you can create a. sh file under/etc/prfile. d/and write the corresponding content, such as JAVA_HOME.