I ran into this problem today as well. You need to make sure the hadoop-hdfs jar is in your classpath.
My first brush at this was to simply add a dependency to my project on the hadoop-hdfs
package in Maven, but this was insufficient. In the end, I followed the Cloudera's advice and added a dependency on hadoop-client
. The relevant clause for your pom.xml
file is:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>VERSION</version>
</dependency>
As I was doing this in Clojure with Leiningen, I added this to my project.clj
file instead:
(defproject
; ...
:dependencies [[org.apache.hadoop/hadoop-client "VERSION"]
; ...
])
(Your version will depend on what is installed on your system, of course. The only release version in the 2.x series at the moment is 2.2.0
.)