首页 新闻 会员 周边

hadoop wordcount

0
悬赏园豆:50 [已解决问题] 解决于 2013-09-02 12:16

5:~$ javac -cp $HADOOP_HOME/hadoop-*-core.jar -d classes WordCount.java
WordCount.java:53: error: cannot access Options
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
^
class file for org.apache.commons.cli.Options not found
1 error

之后 网上说 加上common-cli-1.2.jar

出现了新的错误 求帮助

symbol: class Path
location: class WordCount
/home/a3/WordCount.java:65: error: cannot find symbol
FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
^
symbol: variable FileInputFormat
location: class WordCount
/home/a3/WordCount.java:66: error: cannot find symbol
FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));
^
symbol: class Path
location: class WordCount
/home/a3/WordCount.java:66: error: cannot find symbol
FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));
^
symbol: variable FileOutputFormat
location: class WordCount
42 errors

wusuo的主页 wusuo | 初学一级 | 园豆:111
提问于:2013-08-15 10:28
< >
分享
最佳答案
2

去。 感觉你的CP也太简单了。hadoop-core依赖的jar呢?

收获园豆:50
风云力 | 小虾三级 |园豆:541 | 2013-08-15 15:32

原来用的 -classpath  结果一样

wusuo | 园豆:111 (初学一级) | 2013-08-15 21:05

@wusuo: 你没明白什么意思。 就是你的classpath中漏掉了hadoop 依赖的jars。

加上那几十个jar应该就好了。 common-cli只是hadoop依赖中的一个。。

风云力 | 园豆:541 (小虾三级) | 2013-08-16 10:04

@风云力: 我直接解决了 发现 原来是 * 通配符的问题 修改掉 就行了!!!

wusuo | 园豆:111 (初学一级) | 2013-08-28 10:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册