When passing a -D parameter in Java, what is the proper way of writing the command-line and then accessing it from code?
For example, I have tried writing something like this...
if (System.getProperty("test").equalsIgnoreCase("true"))
{
//Do something
}
And then calling it like this...
java -jar myApplication.jar -Dtest="true"
But I receive a NullPointerException. What am I doing wrong?