While working on Hadoop Implementation in Pseudo-Distributed Operation, I found following exception of JAVA_HOME variable not set, 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.
usr@usr-HP-G62-Notebook-PC:~/hadoop-0.20.203.0$ echo $JAVA_HOME
/usr/lib/jvm/java-6-sun
usr@usr-HP-G62-Notebook-PC:~/hadoop-0.20.203.0$ bin/start-all.sh
starting namenode, logging to /home/usr/hadoop-0.20.203.0/bin/../logs/hadoop-usr-namenode-usr-HP-G62-Notebook-PC.out
localhost: starting datanode, logging to /home/usr/hadoop-0.20.203.0/bin/../logs/hadoop-usr-datanode-usr-HP-G62-Notebook-PC.out
localhost: Error: JAVA_HOME is not set.
localhost: starting secondarynamenode, logging to /home/usr/hadoop-0.20.203.0/bin/../logs/hadoop-usr-secondarynamenode-usr-HP-G62-Notebook-PC.out
localhost: Error: JAVA_HOME is not set.
starting jobtracker, logging to /home/usr/hadoop-0.20.203.0/bin/../logs/hadoop-usr-jobtracker-usr-HP-G62-Notebook-PC.out
localhost: starting tasktracker, logging to /home/usr/hadoop-0.20.203.0/bin/../logs/hadoop-usr-tasktracker-usr-HP-G62-Notebook-PC.out
localhost: Error: JAVA_HOME is not set.