java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries. spark Eclipse on windows 7

前端 未结 12 709
名媛妹妹
名媛妹妹 2020-11-28 02:49

I\'m not able to run a simple spark job in Scala IDE (Maven spark project) installed on Windows 7

Spark core dependency has be

相关标签:
12条回答
  • 2020-11-28 03:25

    On Windows 10 - you should add two different arguments.

    (1) Add the new variable and value as - HADOOP_HOME and path (i.e. c:\Hadoop) under System Variables.

    (2) Add/append new entry to the "Path" variable as "C:\Hadoop\bin".

    The above worked for me.

    0 讨论(0)
  • 2020-11-28 03:27

    Here is a good explanation of your problem with the solution.

    1. Download winutils.exe from http://public-repo-1.hortonworks.com/hdp-win-alpha/winutils.exe.
    2. SetUp your HADOOP_HOME environment variable on the OS level or programmatically:

      System.setProperty("hadoop.home.dir", "full path to the folder with winutils");

    3. Enjoy

    0 讨论(0)
  • 2020-11-28 03:27

    Setting the Hadoop_Home environment variable in system properties didn't work for me. But this did:

    • Set the Hadoop_Home in the Eclipse Run Configurations environment tab.
    • Follow the 'Windows Environment Setup' from here
    0 讨论(0)
  • 2020-11-28 03:32

    You can alternatively download winutils.exe from GITHub:

    https://github.com/steveloughran/winutils/tree/master/hadoop-2.7.1/bin

    replace hadoop-2.7.1 with the version you want and place the file in D:\hadoop\bin

    If you do not have access rights to the environment variable settings on your machine, simply add the below line to your code:

    System.setProperty("hadoop.home.dir", "D:\\hadoop");
    
    0 讨论(0)
  • 2020-11-28 03:34
    1) Download winutils.exe from https://github.com/steveloughran/winutils 
    2) Create a directory In windows "C:\winutils\bin
    3) Copy the winutils.exe inside the above bib folder .
    4) Set the environmental property in the code 
      System.setProperty("hadoop.home.dir", "file:///C:/winutils/");
    5) Create a folder "file:///C:/temp" and give 777 permissions.
    6) Add config property in spark Session ".config("spark.sql.warehouse.dir", "file:///C:/temp")"
    
    0 讨论(0)
  • 2020-11-28 03:38

    I have also faced the similar problem with the following details Java 1.8.0_121, Spark spark-1.6.1-bin-hadoop2.6, Windows 10 and Eclipse Oxygen.When I ran my WordCount.java in Eclipse using HADOOP_HOME as a system variable as mentioned in the previous post, it did not work, what worked for me is -

    System.setProperty("hadoop.home.dir", "PATH/TO/THE/DIR");

    PATH/TO/THE/DIR/bin=winutils.exe whether you run within Eclipse as a Java application or by spark-submit from cmd using

    spark-submit --class groupid.artifactid.classname --master local[2] /path to the jar file created using maven /path to a demo test file /path to output directory command

    Example: Go to the bin location of Spark/home/location/bin and execute the spark-submit as mentioned,

    D:\BigData\spark-2.3.0-bin-hadoop2.7\bin>spark-submit --class com.bigdata.abdus.sparkdemo.WordCount --master local[1] D:\BigData\spark-quickstart\target\spark-quickstart-0.0.1-SNAPSHOT.jar D:\BigData\spark-quickstart\wordcount.txt

    0 讨论(0)
提交回复
热议问题