Tuesday, November 16, 2010

How to run and compile a Hadoop program

Suppose you created a Java map reduce file WordCount.java then running a hadoop program needs to be done in 3 steps.

COMPILE
javac -classpath ${HADOOP_CLASSES} -d WordCount/ WordCount.java

CREATE JAR
jar -cvf WordCount.jar -C WordCount/ .

RUN
hadoop jar WordCount.jar org.myorg.WordCount /user/tommy/test/ /user/tommy/testout

2 comments:

  1. I m doing the same
    but i m not able to run even a single programm

    I m getting t problem in compiling prog as compiler not able to find org.apache package

    please help me to do this

    ReplyDelete
  2. Mahesh - What is the exact error message you are seeing? Can u post it here.

    ReplyDelete