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

I got this error while starting DFS in a new hadoop standalone deployment.

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

But JAVA_HOME is set in etc/hadoop/hadoop-env.sh

export JAVA_HOME=${JAVA_HOME}

But java home is set properly using the environment variables.

$ echo $JAVA_HOME
/usr/lib/jvm/java-7-oracle/

Hardcoding the java path in etc/hadoop/hadoop-env.sh solved this issue.

# The java implementation to use.
#export JAVA_HOME=${JAVA_HOME}
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/

Hadoop: hadoop-2.6.4

OS: Ubuntu 16.04 LTS

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s