E:\cn\zno\commandline\Test.class
package cn.zno.commandline; import java.lang.management.ManagementFactory; public class Test {
public static void main(String[] args) {
System.out.println("VM arguments:" + ManagementFactory.getRuntimeMXBean().getInputArguments());
System.out.println("Program arguments:");
for (String arg : args) {
System.out.println(arg);
}
}
}
java [-options] class [args...]
E:\>java -Xms32m -Xmx32m cn.zno.commandline.Test a b
VM arguments:[-Xms32m, -Xmx32m]
Program arguments:
a
b