I am trying to import a Hadoop class to use in my project.
import org.apache.hadoop.fs.*;
I would normally expect to go out into the world and try to find a Hadoop JAR file to include, put it in a libs folder in eclipse, then use the classes. Having done that and not found what I expected, I ask: what is the right way to include Hadoop classes in my own Java class so that I can use them in eclipse?
I found Hadoop documentation frustrating because it has an incredibly short shelf life. Advice from six months ago apparently is totally worthless.
Using maven and the m2e plugin, a hadoop project is as simple as:
And maven will handle downloading the jar and dependencies for you, the Eclipse maven plugin will manage the build path for you.
I’m sure there’s a Eclipse ivy plugin too, that will do the same thing for Ant