【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd )

这篇具有很好参考价值的文章主要介绍了【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd )。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。


总结 :

报错 : Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd

JDK 安装在了 C:\Program Files\ 目录下 , 安装目录 Program Files 有空格 , 太坑了 ;

换一个没有空格的 JDK 目录 ;





一、报错信息



安装 Hadoop 运行环境 ,

完成上述安装步骤后 , 运行 hadoop 命令报错 ;


C:\Windows\system32>hadoop -version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
     Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd
‘-Xmx512m’ is not recognized as an internal or external command,
operable program or batch file.


报错信息如下 :

C:\Windows\system32>hadoop -version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
       Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd
'-Xmx512m' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\system32>hadoop -version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
       Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd
'-Xmx512m' is not recognized as an internal or external command,
operable program or batch file.

【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd ),开发环境,错误记录,java,hadoop,原力计划





二、问题分析



核心报错信息 :

Error: JAVA_HOME is incorrectly set.
     Please update D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd

那就是 在 D:\001_Develop\052_Hadoop\hadoop-3.3.4\etc\hadoop\hadoop-env.cmd 文件中的 JAVA_HOME 设置错误 ;

设置内容如下 :

set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_91

【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd ),开发环境,错误记录,java,hadoop,原力计划

问题就是出在这个路径上 , 这个路径是 JDK 的实际路径 ;

但是路径中出现一个空格 , 这就导致了运行 Hadoop 报错 ;





三、解决方案



换一个没有空格的 JDK :

set JAVA_HOME=D:\001_Develop\031_Java8u144_Frida\jdk1.8.0_144

【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd ),开发环境,错误记录,java,hadoop,原力计划

再次运行

hadoop -version

命令 , 此时 Hadoop 运行成功 ;

C:\Windows\system32>hadoop -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode)

【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd ),开发环境,错误记录,java,hadoop,原力计划

运行

hadoop

命令 , 可以正确运行 ;

C:\Windows\system32>hadoop
Usage: hadoop [--config confdir] [--loglevel loglevel] COMMAND
where COMMAND is one of:
  fs                   run a generic filesystem user client
  version              print the version
  jar <jar>            run a jar file
                       note: please use "yarn jar" to launch
                             YARN applications, not this command.
  checknative [-a|-h]  check native hadoop and compression libraries availability
  conftest             validate configuration XML files
  distch path:owner:group:permisson
                       distributed metadata changer
  distcp <srcurl> <desturl> copy file or directories recursively
  archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive
  classpath            prints the class path needed to get the
                       Hadoop jar and the required libraries
  credential           interact with credential providers
  jnipath              prints the java.library.path
  kerbname             show auth_to_local principal conversion
  kdiag                diagnose kerberos problems
  key                  manage keys via the KeyProvider
  trace                view and modify Hadoop tracing settings
  daemonlog            get/set the log level for each daemon
 or
  CLASSNAME            run the class named CLASSNAME

Most commands print help when invoked w/o parameters.

【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd ),开发环境,错误记录,java,hadoop,原力计划文章来源地址https://www.toymoban.com/news/detail-716237.html

到了这里,关于【错误记录】安装 Hadoop 运行环境报错 ( Error: JAVA_HOME is incorrectly set. Please update xxx\hadoop-env.cmd )的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包