Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hadoop jar ignores specified main class [closed]

Tags:

java

jar

hadoop

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?

like image 717
leventov Avatar asked Feb 19 '23 03:02

leventov


1 Answers

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.

like image 118
Grooveek Avatar answered Feb 23 '23 20:02

Grooveek