eclipse中mapreduce程序编译打包出错的解决

必须在项目中手动添加MANIFEST.MF ,并写入如下内容

例如我们打包的jar为 Test.jar

Manifest-Version: 1.0
Main-Class: windows.VideoWindow
Class-Path: lib\org.eclipse.swt_3.3.0.v3346.jar lib\org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar

否则报错:
could not find main class.

经过我的测试,class-path这项不设置也可以。

或者没有MANIFEST.MF 文件也可以,但在hadoop中运行的时候要指定包名,否则无法定位还是会报错could not find main class. 或类似的。