I was hoping somebody could help me with this problem...
I'm trying to pass in an argument from command line. This argument is going to ether enable debugging or not.
Here's the command line I'm using:
<font class="small">Code:</font><hr /><pre>
java -cp myathslusath:to:bin:folder -DsomeName=someValue org.junit.runner.JUnitCore MyClass
Then, in my code, I try to retrieve this value by doing this:
<font class="small">Code:</font><hr /><pre>System.getProperty("someName")</pre><hr />, but it always returns 'null'
Any help is appreciated!
The command I was using actually works!
I was confused because I was trying to use it within Eclipse and I plugged in -DpropName=propValue into "Application parameters" instead of "VM Parameters" field.