I am installing Hadoop on CentOS 6.4.
Following these instructions http://hadoop.apache.org/docs/stable/single_node_setup.html
wget http://apache.osuosl.org/hadoop/common/hadoop-1.1.2/hadoop-1.1.2-1.x86_64.rpm
chmod 700 hadoop-1.1.2-1.x86_64.rpm
rpm -Uvh hadoop-1.1.2-1.x86_64.rpm
Java is located at /usr/bin/java
[root@localhost ~]# /usr/bin/java -version
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
set JAVA_HOME
vi /etc/hadoop/hadoop-env.sh
changed
export JAVA_HOME=/usr/bin/java/bin/java
to
export JAVA_HOME=/usr/bin/java
[root@localhost ~]# . /etc/hadoop/hadoop-env.sh
[root@localhost ~]# echo $JAVA_HOME
/usr/bin/java
But Hadoop still fails as it has the old incorrect Java path
[root@localhost ~]# /usr/bin/hadoop version
/usr/bin/hadoop: line 320: /usr/bin/java/bin/java: Not a directory
How do I correct this error message?