In order to facilitate run multiple java program, chose to write the script for unified management. The method of the brief transmission parameters.
To assume file.java transmission parameters,
. Step1 Mr. .class files need to:
javac Test.java
. Step2 is defined in the script parameters:
int_a=5
double_b=3.0
string_c=aaa
. Step3 arguments:
java Test $int_a $double_b $string_c
step4.file.java accept parameters
public static void main(String args[]) {
if (args.length < 3) {
System.out.println("error ");
} else {
a = Integer.valueOf(args[0]).intValue();
b = Double.parseDouble(args[1]);
c = args[2];
}
}