Java Project export as jar package + export third-party jar + use command-line Invoke + Pass-through, package
Scenario 1: You do not need to pass parameters to the program, and the program does not use third-party jar packages
Export jar on eclipse:
Then select a Java file to be used as the storage, with main () Main function:
Scenario 2: parameters are passed to the program, and the program does not use a third-party jar package
In this case packaging and Case 1 are the same
Scenario 3: The program uses a third-party jar package
In this case, packaging is more complex, you need to export the third-party jar package, you can use the Eclipse plug-in fat jar, it is simple, but the fat jar only supports Eclipse 4.3 and the following version, the new version of Eclipse will not be loaded;
Second, use the command line call (or call in the bat file)
1. No reference
Open the directory where the jar package is located, enter Java-jar Xxx.jar
2. Have a reference
Open the directory where the jar package is entered Java-jar xxx.jar parameter 1 parameter 2 ... (separated by a space between parameters)
Corresponding to the main function:
Public Static void = args[0]; // String targetpath = args[1]; parameter 2 }
Java Project export as jar package + export Third party jar + use command line Invoke + Pass