在hadoop上运行java文件

hadoop 2.x版本

编译:
javac -d . -classpath /usr/lib/hadoop/hadoop-common-2.2.0.2.0.6.0-102.jar TestGetPathMark.java

(classpath多个jar包用分号分隔 /opt/1.jar:/opt/2.jar)


在com的同级目录上建立manifest.mf

在里面写上Main-Class: com.test.path.mark.TestGetPathMark

d打包:
然后保存并执行jar -cvfm test.jar manifest.mf com/


然后执行hadoop jar test.jar args[]

原文地址:https://www.cnblogs.com/sunxucool/p/3892293.html