I have Oracle jdk7 installed on my centos6. I noticed that the /etc/profile has the lines below:#below lines are added for Javaexport JAVA_HOME=/usr/java/latest## export JAVA_HOME JDK ##export JAVA_HOME=/usr/java/jdk1.7.0_75In order to test my assumptions on env variables and PATHs, I commented all the lines above (the export lines). I tried to load the new /etc/profile by sourcing it . /etc/profile and issued the echo $JAVA_HOME; it still returned the above path. So, I rebooted the machine as the source didn't work. After the reboot, the echo $JAVA_HOME returns nothing, which is expected. There is nothing in ~/.bash_profile for Java. But if I issue the command:  java -version on the shell, it still returns [root@localhost ~]# java -versionjava version 1.7.0_75Java(TM) SE Runtime Environment (build 1.7.0_75-b13)Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)Where is the Java defined in the PATH? the path in the ~/.bash_profile is as below, it doesn't have any for Java.# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH~~~set - on the shell returns the line below for the PATH variable:PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
Question on environmental variable
environment variables;java;etc
The default PATH is set in /etc/profile. Users can modify their PATH by editing ~/.profile, ~/.bash_profile or ~/.bashrc (if they're running bash) but if they don't they will still have a PATH as defined in /etc/profile. That's why the line wasPATH=$PATH:$HOME/binand not just PATH=$HOME/binThat way, the original value of PATH is kept and the new directory is simply appended. On my system, the PATH set in /etc/profile isPATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/gamesYou probably have a very similar line in yours and that's where /usr/bin comes from.