title: Is there any way to set Java system properties in a .jar file so that they have default values but can be overridden at the command line?
body: <p>Is there any way to set Java system properties in a .jar file (e.g. via the JAR manifest) so that they have default values but can be overridden at the command line?</p>
  
  <p>For example, suppose I wanted to set the system property <code>foo.bar</code> to <code>haha</code>:</p>
  
  <pre><code> java -jar myprog.jar
  </code></pre>
  
  <p>would default <code>foo.bar</code> to <code>haha</code> but</p>
  
  <pre><code> java -D foo.bar=hoho -jar myprog.jar
  </code></pre>
  
  <p>would set <code>foo.bar</code> to <code>hoho</code>.</p>
  
  <hr>
  
  <p>Update: This should not touch the system args used in main(String[] args).</p>