title: Cannot connect to remote HDFS from Windows
body: <p>i am trying to connect to a remote HDFS instance as</p>
  
  <pre><code>        Configuration conf = new Configuration();
          conf.set("fs.defaultFS", "hdfs://hostName:8020");
          conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
          FileSystem fs = FileSystem.get(conf);
          RemoteIterator&lt;LocatedFileStatus&gt; ri = fs.listFiles(fs.getHomeDirectory(), false);
          while (ri.hasNext()) {
              LocatedFileStatus lfs = ri.next();
              //log.debug(lfs.getPath().toString());
          }
  
          fs.close();
  </code></pre>
  
  <p>here are my Maven dependencies</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
          &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
          &lt;artifactId&gt;hadoop-mapreduce-client-core&lt;/artifactId&gt;
          &lt;version&gt;2.7.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
          &lt;artifactId&gt;hadoop-client&lt;/artifactId&gt;
          &lt;version&gt;2.7.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
          &lt;artifactId&gt;hadoop-examples&lt;/artifactId&gt;
          &lt;version&gt;1.2.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
          &lt;artifactId&gt;hadoop-hdfs&lt;/artifactId&gt;
          &lt;version&gt;2.7.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>and here is the result of hadoop version command on my remote node</p>
  
  <pre><code>hadoop version
  Hadoop 2.7.1.2.3.0.0-2557
  </code></pre>
  
  <p>but i get </p>
  
  <pre><code>Exception in thread "main" java.lang.UnsupportedOperationException: Not implemented by the DistributedFileSystem FileSystem implementation
  at org.apache.hadoop.fs.FileSystem.getScheme(FileSystem.java:217)
  at org.apache.hadoop.fs.FileSystem.loadFileSystems(FileSystem.java:2624)
  at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2634)
  at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2651)
  at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:92)
  at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2687)
  at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2669)
  at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:371)
  at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:170)
  at filecheck.HdfsTest.main(HdfsTest.java:21)
  </code></pre>
  
  <p>and this is the line that causes the error</p>
  
  <pre><code>FileSystem fs = FileSystem.get(conf);
  </code></pre>
  
  <p>any idea why this might be happening?</p>
  
  <p><strong>After trying Manjunath's answer</strong></p>
  
  <p>here is what i get</p>
  
  <pre><code>ERROR util.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:356)
      at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:371)
      at org.apache.hadoop.util.Shell.&lt;clinit&gt;(Shell.java:364)
      at org.apache.hadoop.util.StringUtils.&lt;clinit&gt;(StringUtils.java:80)
      at org.apache.hadoop.fs.FileSystem$Cache$Key.&lt;init&gt;(FileSystem.java:2807)
      at org.apache.hadoop.fs.FileSystem$Cache$Key.&lt;init&gt;(FileSystem.java:2802)
      at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2668)
      at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:371)
      at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:170)
      at filecheck.HdfsTest.main(HdfsTest.java:27)
  15/11/16 09:48:23 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  Exception in thread "main" java.lang.IllegalArgumentException: Pathname  from hdfs://hostName:8020 is not a valid DFS filename.
      at org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:197)
      at org.apache.hadoop.hdfs.DistributedFileSystem.access$000(DistributedFileSystem.java:106)
      at org.apache.hadoop.hdfs.DistributedFileSystem$DirListingIterator.&lt;init&gt;(DistributedFileSystem.java:940)
      at org.apache.hadoop.hdfs.DistributedFileSystem$DirListingIterator.&lt;init&gt;(DistributedFileSystem.java:927)
      at org.apache.hadoop.hdfs.DistributedFileSystem$19.doCall(DistributedFileSystem.java:872)
      at org.apache.hadoop.hdfs.DistributedFileSystem$19.doCall(DistributedFileSystem.java:868)
      at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
      at org.apache.hadoop.hdfs.DistributedFileSystem.listLocatedStatus(DistributedFileSystem.java:886)
      at org.apache.hadoop.fs.FileSystem.listLocatedStatus(FileSystem.java:1694)
      at org.apache.hadoop.fs.FileSystem$6.&lt;init&gt;(FileSystem.java:1787)
      at org.apache.hadoop.fs.FileSystem.listFiles(FileSystem.java:1783)
      at filecheck.HdfsTest.main(HdfsTest.java:29)
  </code></pre>