I am not sure why the paths that java and whereis java are wrong. I tried to modify the ~ / .bash_profile and / etc / environment file, but didn't help. The desired path is what is seen in " echo $ JAVA_HOME " below, but the same is not reflected in " which java "
Below I get in CentOS 6.4:
which java
/ Usr / bin / java
java -version
java version "1.7.0_45"
JAVA (TM) SE Runtime Environment (build 1.7.0_45-b18)
JAVA HotSpot (TM) 64-bit server VM (build 24.45-b08, mixed mode)
whereis java
java: / usr / bin / java / etc / java / usr / lib / java / usr / share / java
echo $ JAVA_HOME
/usr/java/jdk1.7.0_45/jre = > , echo $JAVA_HOME