hadoop jar忽略指定的主类[关闭](hadoop jar ignores specified main class [closed])

编程入门 行业动态 更新时间:2024-10-25 04:20:03
hadoop jar忽略指定的主类[关闭](hadoop jar ignores specified main class [closed])

我的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.

更多推荐

本文发布于:2023-08-07 10:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463811.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ignores   jar   hadoop   closed   class

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!