What version of dm-server you are using?
If v2.0 - you can easily do this by creating a setevn.sh/bat script in the bin directory and add your properties there
Code:
# *ix type os system
JAVA_OPTS="$JAVA_OPTS \
-Xmx512m \
-XX:PermSize=128m \
-Dbundles.configuration.location=$KERNEL_HOME/config/propsloader/ \
-Dspring.security.strategy=MODE_INHERITABLETHREADLOCAL \
-Dsolr.solr.home=$KERNEL_HOME/solr/"
dmk.sh/bat picks up JAVA_OPTS and passes them to the java process.
If you need to set something programmatically - your code will need to call
System.setProperty(key, val); somewhere.