运行hadoop的WordCount程序——编译,打包,运行
1.hadoop程序编译,奇怪,用户主目录用~来代替时会报错
javac -classpath /home/hejun/app/hadoop/hadoop-core-1.0.1.jar:/home/hejun/app/hadoop/lib/commons-cli-1.2.jar -d . WordCount.java
2.打包
jar -cvf wordcount.jar -C ?./ .
3.运行
hadoop jar wordcount.jar org.apache.hadoop.examples.WordCount /user/hejun/input /user/hejun/output
?
一个完整的例子可以参考:http://book.51cto.com/art/201111/304553.htm