启动hadoop,报错Error 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时报错,如下所示

        启动hadoop,报错Error JAVA_HOME is not set and could not be found

        解决方法:

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

               启动hadoop,报错Error JAVA_HOME is not set and could not be found

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

               启动hadoop,报错Error JAVA_HOME is not set and could not be found

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

         启动hadoop,报错Error JAVA_HOME is not set and could not be found

                 解决方法:

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

                          启动hadoop,报错Error JAVA_HOME is not set and could not be found

文章来源:http://www.cnblogs.com/codeOfLife/p/5940642.html