Java – Compiling Hadoop 2.2.0 jobs?

Compiling Hadoop 2.2.0 jobs?… here is a solution to the problem.

Compiling Hadoop 2.2.0 jobs?

It seems that all the examples were built with older versions in mind.

How do I compile my java program on Ubuntu so that it references the hadoop-2.2.0 library?

Where are the jar files I should include?

What is the command?
Is it –

javac -classpath libraries

Thank you.


The simplest solution for Linux machines is:

javac -classpath `yarn classpath` -d .


export CLASSPATH=`yarn classpath`
javac -classpath $CLASSPATH -d .

Related Problems and Solutions