gpt4 book ai didi

hadoop - 运行示例 wordcount "Exception in thread "main"

转载 作者:可可西里 更新时间:2023-11-01 16:16:25 26 4
gpt4 key购买 nike

我尝试运行示例wordcount程序,我的hdfs文件保存在/input中,输出目录是/output,这是我执行的命令:

[hadoop-2.2.0]$ bin/hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/sources/hadoop-mapreduce-examples-2.2.0-sources.jar org.apache.hadoop.examples.WordCount /input /output

但是我得到了以下错误:

Exception in thread "main" java.lang.ClassNotFoundException: org.apache.hadoop.examples.WordCount
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at org.apache.hadoop.util.RunJar.main(RunJar.java:205

最佳答案

试试 hadoop-mapreduce-examples-2.2.0.jar

bin/hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.2.0.jar wordcount /input /output

如果你确实想使用源jar,你可以先运行下面的命令:

unset HADOOP_CLASSPATH

关于hadoop - 运行示例 wordcount "Exception in thread "main",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20026046/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com