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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With