title: Set up HADOOP_HOME variable in windows
body: <p>I am trying to use Spark along with Hadoop in my Windows 8. However no matter what my code is, I receive this error:</p>
  
  <pre><code>15/08/25 19:29:58 ERROR Shell: Failed to locate the winutils binary in the hadoop binary path
  java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
      at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:355)
      at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:370)
      at org.apache.hadoop.util.Shell.&lt;clinit&gt;(Shell.java:363)
      at org.apache.hadoop.util.StringUtils.&lt;clinit&gt;(StringUtils.java:79)
      at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:104)
      at org.apache.hadoop.security.Groups.&lt;init&gt;(Groups.java:86)
      at org.apache.hadoop.security.Groups.&lt;init&gt;(Groups.java:66)
      at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:280)
      at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:271)
      at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:248)
      at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:763)
      at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:748)
      at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:621)
      at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2162)
      at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2162)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.util.Utils$.getCurrentUserName(Utils.scala:2162)
      at org.apache.spark.SparkContext.&lt;init&gt;(SparkContext.scala:301)
      at org.apache.spark.api.java.JavaSparkContext.&lt;init&gt;(JavaSparkContext.scala:61)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:234)
      at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:379)
      at py4j.Gateway.invoke(Gateway.java:214)
      at py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:79)
      at py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:68)
      at py4j.GatewayConnectionun(GatewayConnection.java:207)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>As you can see:</p>
  
  <pre><code>null\bin\winutils.exe
  </code></pre>
  
  <p>The hadoop home path is null. I tried to set <code>HADOOP_HOME</code> as an environment variable but that did not resolve this issue.</p>