hadoop start-all.sh报错JAVA_HOME is not set and could not be found.

时间:2024-04-20 00:53:18

原文

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

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

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

hadoop start-all.sh报错JAVA_HOME is not set and could not be found.

解决方法:

输入java –version,查看jdk是否安装成功

hadoop start-all.sh报错JAVA_HOME is not set and could not be found.

输入export,查看jdk环境变量是否设置成功

hadoop start-all.sh报错JAVA_HOME is not set and could not be found.

2、在集群环境下,即使各结点都正确地配置了JAVA_HOME,也会报如下错误

hadoop start-all.sh报错JAVA_HOME is not set and could not be found.

解决方法:

在hadoop-env.sh中,再显示地重新声明一遍JAVA_HOME

hadoop start-all.sh报错JAVA_HOME is not set and could not be found.