日期:2014-05-16 浏览次数:21070 次
ubuntu@ubuntu:~/dev/wordcount$ javac -classpath /home/ubuntu/hadoop-1.0.4/hadoop-core-1.0.4.jar -d bin WordCount.java WordCount.java:53: cannot access org.apache.commons.cli.Options class file for org.apache.commons.cli.Options not found String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs(); ^ 1 error
在网上搜索了一下,找到了原因,在 classpath 中再加上一个 jar 包即可:
ubuntu@ubuntu:~/dev/wordcount$ javac -classpath /home/ubuntu/hadoop-1.0.4/hadoop-core-1.0.4.jar:/home/ubuntu/hadoop-1.0.4/lib/commons-cli-1.2.jar -d bin WordCount.java ubuntu@ubuntu:~/dev/wordcount$ ls bin/*.class bin/WordCount.class bin/WordCount$IntSumReducer.class bin/WordCount$TokenizerMapper.class