我的hadoop版本是0.20.2。 虽然我打字
hadoop jar JarWithSeveralMainClasses.jar NonDefaultMainClass args...它试图执行MainClassSpecifiedInJarManifest main方法。 为什么?
My hadoop version is 0.20.2. Although I type
hadoop jar JarWithSeveralMainClasses.jar NonDefaultMainClass args...It tries to execute main method of MainClassSpecifiedInJarManifest. Why?
最满意答案
我想你可以在这里找到答案
如果jar文件包含其清单文件中指定的主类,则即使命令指定另一个主类 , hadoop也将使用主类 。 这与普通的java执行不同,我们可以指定一个主类来覆盖清单文件中的主类。
如果jar文件不包含清单文件中的主类 ,则hadoop允许我们指定主类。
I think you may find your answer here
If a jar file contains a main class specified in its manifest file, hadoop will take the main class even if the command specify another main class. This is different from normal java execution where we can specify a main class to overwrite the one in the manifest file.
If a jar file does not contain a main class in manifest file, hadoop allows us to specify the main class.
更多推荐
发布评论