How to jar a Java program for Hadoop

I am going through Chapter 2 of Hadoop: The Definitive Guide 4e.

The book tells me to do the following steps:

export HADOOP_CLASSPATH=hadoop-examples.jar
hadoop MaxTemperature input/ncdc/sample.txt output

What is hadoop-examples.jar? How do I jar MaxTemperature?

The code is available here: https://github.com/tomwhite/hadoop-book/tree/master/ch02-mr-intro/src/main/java

Answers


In border of my school studies we did nearly the same.

You just have to compile it directly into a jar file. So you can use it easier from command line or hadoop. Otherwise you would need to compile it with

javac filename1.java filename2.java 

and go on, also with all the libraries.

I guess you use something like Eclipse as IDE. There you can compile it directly into a jar file.

Export > Java > Runnable JAR file

Then you can use it in command line like this:

java -jar filename.jar

or put it into the hadoop cluster.

mfg


Need Your Help

Haskell - Algebraic data types that use recursion?

haskell types algebraic-data-types recursive-datastructures

I've followed a guide to creating a binary search tree which uses the following datatype:

Build Failed Evaluating root project - Gradle

java android eclipse gradle

I am building my gradle project and getting following issue.Please Help me out i am new in android programming