I am debugging a problem in a large system. I was able to locate the problem in a rather basic java feature - the application is started with the -D option to specify some system properties. During run-time though, said properties are not set and their values are null.
Trying to reproduce the issue I created the following very simple application:
public static void main(String[] args) {
String propName = "sysprop";
String propValue = System.getProperty(propName);
System.out.println(propName + "=" + propValue);
}
I start the application with the following command line and to my surprise got the same result:
java -cp javaapplication8.jar javaapplication8.JavaApplication8 -Dsysprop="some value"
sysprop=null
Apparently I am missing something obvious (or lack some basic knowledge) but what is it?
Thank you.