java.io.IOException: Could not locate executable nullinwinutils.exe in the Hadoop binaries.

Posted 留歌__36的博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.io.IOException: Could not locate executable nullinwinutils.exe in the Hadoop binaries.相关的知识,希望对你有一定的参考价值。

问题说明:

一般来说,我编写Spark,MapReduce程序都是会在本地IDEA中进行,开发。本地跑通了,才会把代码放到集群上去跑。

当我在运行一个简单的Spark Job 的时候,控制台出现如下的错误:

java.io.IOException: Could not locate executable nullinwinutils.exe in the Hadoop binaries.

问题解决:

一看不能加载,我就感觉我的机器(Windows 10)可能是因为缺少这个winutils的文件。
我把错误放到google上一搜,方案真的多
我就找了一篇比较不错的,然后完美解决 我的问题。
具体如下:

  1. Download winutils.exe from http://public-repo-1.hortonworks.com/hdp-win-alpha/winutils.exe.
    Also, be sure to download the correct winutils.exe based on the version of hadoop that spark is compiled for (so, not necessarily the link above)

  2. create a folder c:hadoopin

  3. add Download winutils.exe to the c:hadoopin.

  4. Set environment variable HADOOP_HOME to C:hadoop.warning!set HADOOP_HOME to hadoop folder instead of the bin folder.
    OR,System.setProperty("hadoop.home.dir", "C:hadoop") in your code.

参照:https://stackoverflow.com/questions/35652665/java-io-ioexception-could-not-locate-executable-null-bin-winutils-exe-in-the-ha

以上是关于java.io.IOException: Could not locate executable nullinwinutils.exe in the Hadoop binaries.的主要内容,如果未能解决你的问题,请参考以下文章

java.io.IOException: toDerInputStream 拒绝标签类型 77

java.io.IOException:系统找不到指定的路径

java.io.IOException: Connection reset by peer和java.io.IOException: Connection timed out。Socket

android java.io.IOException:传输端点未连接

任务 ':app:compileDebugKotlin' java.io.IOException 执行失败

火花:java.io.IOException:设备上没有剩余空间[再次!]