Koshien
Koshien

Reputation: 156

Ubuntu Hadoop cannot find JAVA_HOME

echo $JAVA_HOME

gives me/usr/lib/jvm/java-8-oracle and I have export JAVA_HOME= /usr/lib/jvm/java-8-oracle in my /usr/local/hadoop/etc/hadoop/hadoop-env.sh. However when I run /usr/local/hadoop/bin/hadoop I got the following error:

/usr/local/hadoop/etc/hadoop/hadoop-env.sh: line 25: export: `/usr/lib/jvm/java-8-oracle': not a valid identifier
Error: JAVA_HOME is not set and could not be found.

I thought I had my JAVA_HOME correctly set, anyone can tell me where I did wrong? Thanks.

Upvotes: 1

Views: 990

Answers (2)

PRAFULLA KUMAR DASH
PRAFULLA KUMAR DASH

Reputation: 33

This Must happened for Multiple JAVA_HOME Defined please check it in .bashrc file or .profile

Upvotes: -1

dmfay
dmfay

Reputation: 2477

Remove that space between the equals sign and the path in your export. Shell scripting can be a little finicky about that kind of thing.

Upvotes: 2

Related Questions