- You can refer to the answer to this question to see if it helps you. https://ask.csdn.net/questions/7579136 < / font > < / a > < / li > < li > you also can refer to this article: Eclipse Chinese tutorial and problem solving
-
How to write your first Java application in Eclipse
Write code with command line parameters in Eclipse
Some of these may solve your problem. You can read the following carefully or in the jump source blog:
-
First write an application in Eclipse like this:
package; public class CommandLine{ public static void main(String[]args){ System.out.println("打印命令行参数"); for(int i=0;i<args.length;i++){ System.out.println(args[i]); } } }
main
Theargs
argument of the tempcodeKey1 function is a command line argument that allows data to be passed while the program is running. The type of the command line argument is an array of strings(String[]
). When running through Eclipse, you need to configure the run parameters and add the command line parameter values to be passed in.
The way to run the above program is slightly different from normal applications.
(1) Click the start icon of the menu bar, select the optionRun Configuration
, then selectJava Application
, select the optionNew Configuration
from the right menu, and create a new Java application run configuration namedCommandLine
.
(2) Modify the configuration ofCommandLine
. Select themain
0 option on theArguments
TAB and enter the command line parameters there.
(3) Click themain
1 button to run the program.