While working on Hadoop Implementation in Pseudo-Distributed Operation, I found following exception of JAVA_HOME variable not setting, but When I tried to echo it, it was set.
Variable is preset in conf/hadoop-env.sh
(edited export JAVA_HOME=/usr/lib/jvm/java-6-sun
), bash.bashrc
.
vardan@vardan-HP-G62-Notebook-PC:~/hadoop-0.20.203.0$ echo $JAVA_HOME
/usr/lib/jvm/java-6-sun
vardan@vardan-HP-G62-Notebook-PC:~/hadoop-0.20.203.0$ bin/start-all.sh
starting namenode, logging to /home/vardan/hadoop-0.20.203.0/bin/../logs/hadoop-vardan-namenode-vardan-HP-G62-Notebook-PC.out
localhost: starting datanode, logging to /home/vardan/hadoop-0.20.203.0/bin/../logs/hadoop-vardan-datanode-vardan-HP-G62-Notebook-PC.out
localhost: Error: JAVA_HOME is not set.
localhost: starting secondarynamenode, logging to /home/vardan/hadoop-0.20.203.0/bin/../logs/hadoop-vardan-secondarynamenode-vardan-HP-G62-Notebook-PC.out
localhost: Error: JAVA_HOME is not set.
starting jobtracker, logging to /home/vardan/hadoop-0.20.203.0/bin/../logs/hadoop-vardan-jobtracker-vardan-HP-G62-Notebook-PC.out
localhost: starting tasktracker, logging to /home/vardan/hadoop-0.20.203.0/bin/../logs/hadoop-vardan-tasktracker-vardan-HP-G62-Notebook-PC.out
localhost: Error: JAVA_HOME is not set.
I simply added to the ./conf/hadoop-env.sh this line:
# The java implementation to use. Required.
export JAVA_HOME=/usr/java/latest
and it helped