Search code examples
bashubuntuhadoopjava-home

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.


Solution

  • 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.