title: Parsing -D command line arguments java
body: <p>What is the best way to parse this command line arguments in java?</p>
  
  <pre><code>$ ant run -Dfilename=(filename_value) -Dmemory_size=(memory_size) -Dk=(k_value)
  </code></pre>
  
  <p>I am not actually using ant but my project will be evaluated on this command line.
  Therefore, I am trying to test this on netbeans by adding this example arguments in run configurations.</p>
  
  <pre><code>-Dfilename="C:\\Users\\y_guz_000\\Dropbox\\active projects\\ExternalSort2\\resources\\input.xml" -Dmemory_size="3"
  -Dk="2"
  </code></pre>
  
  <p>I am outputting the result with:</p>
  
  <pre><code>System.out.println(System.getProperty("filename"));
  System.out.println(System.getProperty("memory_size"));
  System.out.println(System.getProperty("k"));
  </code></pre>
  
  <p>However the result is </p>
  
  <pre><code>null
  null
  null
  </code></pre>