CentOS hadoop启动错误 JAVA_HOME is not set and could not be found

来源:互联网 发布:公共软件服务包括什么 编辑:程序博客网 时间:2024/05/16 08:24

...

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