title: Command-line arguments vs File properties (*.properties) vs System Properties (-D) in Java
body: <p>There is a number of way one can pass arguments to Java application. Among them are: </p>
  
  <ol>
  <li>Command-line arguments</li>
  <li>Properties files (<code>properties</code>-style)</li>
  <li>System properties (passed via <code>-D</code> option)</li>
  <li>System environment variables</li>
  </ol>
  
  <p>Ideologically, when should one prefer ones against the others? 
  For example, if one has a lot of parameters to pass to the application, is there any reason to favor command-line parameters over *.properties file?</p>
  
  <p>Or, for example, one can easily access System variable from any class deep down the stack (as opposed to CLI, which is only accessible in <code>main</code>). Should one prefer using System properties over CLI only because of the ease of access?</p>