Error while executing hadoop-mapreduce-examples-2.2.0.jar

﹥>﹥吖頭↗ 提交于 2019-12-13 04:43:03

问题


Being a beginner to hadoop,I started to try out configuring a single node hadoop cluster in ubuntu. After installation and configuration, I worked with the example part with hadoop and it have thrown the following error

hduser1@ubuntu:/usr/local/hadoop$ hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-   examples-2.2.0.jar pi 2 5
java.lang.NoSuchMethodError: org.apache.hadoop.util.ProgramDriver.run([Ljava/lang/String;)I
    at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

I have used Java-7-oracle and Ubuntu 12.04 and followed this post to install and configure hadoop: http://codesfusion.blogspot.in/2013/10/setup-hadoop-2x-220-on-ubuntu.html


回答1:


The error message means that while the runtime was able to find the class ProgramDriver, the function run() is not present.

The most likely reason for this is that you're running an old version of Hadoop that exposed a difference interface in ProgramDriver. About a year ago this method was renamed to run() after being called driver().

The fix for that would be making sure you're running a recent version of Hadoop.



来源:https://stackoverflow.com/questions/22283412/error-while-executing-hadoop-mapreduce-examples-2-2-0-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!