Jar example in Hadoop release

I study Hadoop with Chuck Lama's book “Hadoop in Action”. The first chapter of the book says that installing Hadoop will have an example jar, and running "hasoop jar hadoop - * - examples.jar" will show all the examples. But when I run the command, then it gives the error "Could not find or load the main class org.apache.hadoop.util.RunJar". I assume that the installed Hadoop has no jar example. I installed "hadoop-2.1.0-beta.tar.gz" on cygwin on a Win 7 laptop. Please suggest how to get jar example.

+4
source share
2 answers

run the following command

hasoop jar PathToYourJarFile wordcount inputPath OutputPath

you can get an example jar file in your suoop installation directory

+2
source

What I can offer here, you should manually go to the Hadoop installation directory and find a banner name similar to hasoop-examples.jar. Different distributions may have different names for the flag.

If you are in Cygwin and in the Hadoop installation directory you can also do ls *examples*.jar to find the same, narrowing the list of files to any jar file containing examples as a string.

Then you can directly use the jar file name, for example -

 hadoop jar <exampleJarYourFound.jar> 

Hope this leads you to a solution.

+1
source

Source: https://habr.com/ru/post/1502279/


All Articles