I am baffled….
I am using jdk1.6.0_24, Eclipse 3.6.2 on Windows7. Everything is 64bit.
The problem I am having is, the property (such as -Dmyki=helloDumbo) that I pass from Eclipse via the Run->Run Configuration->Arguments does not seems to get passed to my program.
As an example I have the following:
public static void main(String[] args)
{
String s = System.getProperty("myki");
System.out.println("myki = " + s);
System.out.println("Arg = " + args[0]);
}
And my output is:
myki = null
Arg = -Dmyki=helloDumbo
From the above it seems that Eclipse passed down the arguments I put into the JVM but why System.getProperty() returned null?
Make sure you put it in as a
VM argumentnot aProgram argument: