0

i follow the tutorial whose link is here

i configured all the steps correctly. but in the step 8 that is Example MapReduce job using word count it throws exception when i execute command

./bin/hadoop jar /home/ila/hadoop-0.20.1-examples.jar wordcount /user/hduser/gutenberg /user/hduser/gutenberg-out

How can i solve this problem. Exception is as follows:-

  hduser@ila:/usr/local/hadoop-0.22.0/bin$ ./hadoop jar /home/ila/hadoop-0.20.1-examples.jar wordcount /user/hduser/gutenberg /user/hduser/gutenberg-out
    Exception in thread "main" java.io.IOException: Error opening job jar: /home/ila/hadoop-0.20.1-examples.jar
    at org.apache.hadoop.util.RunJar.main(RunJar.java:130)
    Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.(ZipFile.java:114)
    at java.util.jar.JarFile.(JarFile.java:133)
    at java.util.jar.JarFile.(JarFile.java:70)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:128)

thanks in advance... [:)] [:)]

2 Answers 2

1

The error is because the jar file being referred in the command (/home/ila/hadoop-0.20.1-examples.jar) in NOT present. Its clear that you are using hadoop-0.22.0 and that wont have hadoop-0.20.1-examples.jar shipped along with it.

Try to find the hadoop-*-examples jar in the hadoop installation directory and use that in the command. That should solve the issue. Typically it will be named as hadoop-0.22.0-examples.jar as the jar naming is related to the hadoop version.

Sign up to request clarification or add additional context in comments.

Comments

1

I'm guessing that there isn't a hadoop-0.20.1-examples.jar file in your home directory (/home/ila)?

Maybe amend as follows (based upon your relative path to the hadoop command):

./bin/hadoop hadoop-0.20.1-examples.jar wordcount /user/hduser/gutenberg /user/hduser/gutenberg-out

Although i see from the link you provided, you are prompted to download the examples jar - where did you download this file too? This should be the path you provide

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.