Working With Hadoop: localhost: Error: JAVA_HOME is not set

后端 未结 11 661
天命终不由人
天命终不由人 2020-12-13 02:19

I\'m working with Ubuntu 12.04 LTS.

I\'m going through the hadoop quickstart manual to make a pseudo-distributed operation. It seems simple and straightforward (eas

11条回答
  •  猫巷女王i
    2020-12-13 03:16

    Ran into the same issue on ubuntu LTS 16.04. Running bash -vx ./bin/hadoop showed it tested whether java was a directory. So I changed JAVA_HOME to a folder and it worked.

    ++ [[ ! -d /usr/bin/java ]]
    ++ hadoop_error 'ERROR: JAVA_HOME /usr/bin/java does not exist.'
    ++ echo 'ERROR: JAVA_HOME /usr/bin/java does not exist.'
    ERROR: JAVA_HOME /usr/bin/java does not exist.
    

    So I changed JAVA_HOME in ./etc/hadoop/hadoop-env.sh to

    export JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre/
    

    and hadoop starts fine. This is also mentioned in this article.

提交回复
热议问题