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.
To set JAVA_HOME, do the following: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1. 6.0_02.
If you're doing any sort of development, or building with Maven or Ant, you need to point to the JDK (Java Development Kit) where utilities such as javac (the Java Compiler) reside. Otherwise, you can point to the JRE (Java Runtime Environment). The JDK contains everything the JRE has and more.
To compile and run Java applications successfully you'll need to setup the JAVA_HOME and PATH environment variables.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With