更新时间:2022-03-02 18:39:48
参数传递之前 .jar文件将是JVM的参数,之后的参数将jar文件传递给用户程序。
Arguments passed before the .jar file will be arguments to the JVM, where are arguments after the jar file will be pass on to the users program.
bin/spark-submit --class classname -Xms256m -Xmx1g something.jar someargument
此处, s
将等于 someargument
,其中 - Xms -Xmx
被传递到JVM。
Here, s
will equal someargument
, where the -Xms -Xmx
are passed into the JVM.
public static void main(String[] args) {
String s = args[0];
}