This is similar to a pretty basic question, I'm trying to find a list of system properties passed to the java program from the command line only. E.g., running
java -Dsome.property=value -Dother.property=value2
I'm trying to get a list of JUST these properties. Ignore the specific property names in the example, the actual command line arguments will be arbitrarily named so it is not feasible to explicitly call System.getProperty("some.property")
for each property I need.
System.getProperties()
returns many properties that I do not have any interest in. Is it possible to differentiate between properties set on the command line when starting the program vs those that come from elsewhere?