有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java hadoop jar忽略指定的主类

我的hadoop版本是0.20.2。 虽然我打字

hadoop jar JarWithSeveralMainClasses.jar NonDefaultMainClass args...

它尝试执行MainClassSpecifiedInJarManifestmain方法。 为什么?


共 (1) 个答案

  1. # 1 楼答案

    我想你可能会找到你的答案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.