I want to pass -D arguments to a Java program, which will set those variables as System Properties. But I have 3 to 4 -D arguments and the list can grow dynamically, so is it possible to add all those arguments into a file and pass it as arguments ?
Default Method
-Dproperty=value
Set a system property value. If value is a string that contains spaces, you must enclose the string in double quotes:
java -Dfoo="some string" SomeClass
I would like to do it as
variables.dat
-Dfoo="some String"
-Dbar="some string"
....
....
java -SOME_OPTION variables.dat SomeClass
Is it possible to achieve this ? Where I dint get any help from net. Please help me out.