In any case, you have to persist in the command line arguments. If the set of arguments is fairly fixed, consider writing a small package or shell script file that does nothing but call java with this set of arguments.
If you just want to run it once with arguments, and then if you restart the application without arguments, you want it to use the arguments of the previous call, do something like this:
pubic static void main(String[] args) { if (args.length == 0) args = readArgsFromFile(); else writeArgsToFile();
Sidenote: For simplicity, I reused args . For better code, if necessary, copy the received or saved parameters to another data structure, another array, property instance, ...
source share