-D to pass properties and values

-D is used to set properties. Properties are strings that can be read inside code and can be specified to the JVM in multiple ways, including this parameter. This parameter can be specified multiple times: one for each parameter/value combination that you want to pass to the program.

Here's an example of this:

java -cp CLASSPATH -DProperty1=Value1 -DProperty2=Value2 MAINCLASS

Properties can be read in the code with the getProperty method of the java.lang.System class, which is also used in the following example to read predefined system properties.