1. 程式人生 > >CentOS hadoop啟動錯誤 JAVA_HOME is not set and could not be found

CentOS hadoop啟動錯誤 JAVA_HOME is not set and could not be found

...

Starting namenodes on []

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

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

...

starting yarn daemons
starting resourcemanager, logging to /home/lihanhui/open-source/hadoop-2.1.0-beta/logs/yarn-admin-resourcemanager-localhost.out
localhost: Error: JAVA_HOME is not set and could not be found

.

直接命令列執行export JAVA_HOME=/PATH/TO/JDK無法解決問題

grep命令發現libexec/hadoop-config.sh檔案中有錯誤提示中的黑體字,於是在對應位置前直接設定export JAVA_HOME=/PATH/TO/JDK

錯誤消失。

hadoop版本:hadoop-2.1.0-beta