更新时间:2023-11-17 11:00:04
Looking at bin/hadoop
script for Hadoop, for executing a jar file it uses this condition --
elif [ "$COMMAND" = "jar" ] ; then
CLASS=org.apache.hadoop.util.RunJar
This says it uses RunJar
class to execute the jar.
If you see the RunJar class, the arguments supported are --
RunJar jarFile [mainClass] args...
where, jarFile is accessed using the following code inside RunJar Class--
int firstArg = 0;
String fileName = args[firstArg++];
File file = new File(fileName);
Hence, fileName points to jarFile, so fileName in my view cannot be a HDFS path as seen above, unless you are somehow able to mount the HDFS in your file system, so that it becomes accessible by the java File
class.