How To Get Hadoop Installed on Ubuntu When There Is a Java Error

Problem scenario:  On Ubuntu, after installing Hadoop, when you enter the command '/usr/local/hadoop/bin/hadoop namenode -format' and you get this error:

"Error: JAVA_HOME is not set and could not be found."

Solution:  Verify Java is installed ('java -version').  If it is not installed, you can use 'apt-get install -y default-jre'.

Next, go to hadoop-env.sh.  Find the export JAVA_HOME stanza.  Change the '${JAVA_HOME}' value to '/usr' with no quotes.

Leave a comment

Your email address will not be published.