Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

JAVA HOME need to be set just to /usr so that adding bin/java will get you to the right place.

# export JAVA_HOME="/usr"
# /usr/bin/hadoop version
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.