启动Hadoop报错JAVA_HOME is not set and could not be found

报如错误:JAVA_HOME is not set and could not be found,可能是因为JAVA_HOME环境没配置正确,还有一种情况是即使各结点都正确地配置了JAVA_HOME,但在集群环境下还是报该错误,解决方法是显示地重新声明一遍JAVA_HOME。

1、检查JAVA_HOME是否配置正确(伪分布式环境)

     启动start-all.sh时报错,如下所示

1
解决方法

  • 输入java –version,查看jdk是否安装成功
  • 2
  • 输入export,查看jdk环境变量是否设置成功
  • 启动Hadoop报错JAVA_HOME is not set and could not be found_第1张图片
    2、在集群环境下,即使各结点都正确地配置了JAVA_HOME,也会报如下错误
    启动Hadoop报错JAVA_HOME is not set and could not be found_第2张图片
  • 解决方法
  • 在hadoop-env.sh中,再显示地重新声明一遍JAVA_HOME
    启动Hadoop报错JAVA_HOME is not set and could not be found_第3张图片

你可能感兴趣的:(报错)