I am a beginner with hadoop and trying to install and run hadoop in my Ubuntu as a single node cluster. This is my JAVA_HOME in my hadoop_env.sh
# The java implementation to use.
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/
export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/etc/hadoop"}
But when I run it the following errors come-
Starting namenodes on [localhost]
localhost: Error: JAVA_HOME is not set and could not be found.
localhost: Error: JAVA_HOME is not set and could not be found.
Starting secondary namenodes [0.0.0.0]
0.0.0.0: Error: JAVA_HOME is not set and could not be found.
How do I remove this error?
All you need to do to fix this error is edit the JAVA_HOME variable and point it to the correct directory. The JAVA_HOME environment variable must point to the root of the installation folder of a JDK. It cannot point to a sub-directory of the JDK, and it cannot point to a parent directory that contains the JDK.
Verify JAVA_HOMEOpen a Command Prompt window (Win⊞ + R, type cmd, hit Enter). Enter the command echo %JAVA_HOME% . This should output the path to your Java installation folder. If it doesn't, your JAVA_HOME variable was not set correctly.
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.
Under your HADOOP_HOME/conf directory please update the hadoop-env.sh
file. It has entry to export JAVA_HOME.
Setting to appropriate JAVA_HOME in this file should solve your issue.
Are you loading hadoop_env.sh
? you may be refering to hadoop-env.sh
( dash instead of underscore - that is under conf directory)
BTW, This is a very useful guide for quick installation :
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/
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