title: How to execute Hadoop Jar with external properties
body: <p>I have a jar application that works with an external properties file. The file is used so that the user can override default properties. The default and core properties are part of the build so no problem there.</p>
  
  <p>Normaly I would do something like one of theese:</p>
  
  <pre><code>java -jar MyAwesomeApp.jar user.properties
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>java -jar MyAwesomeApp.jar -Dmyapp.userproperties=user.properties
  </code></pre>
  
  <p>But with hadoop, the jar gets executed inside the hadoop framework like this</p>
  
  <pre><code>/bin/hadoop jar MyAwesomeApp.jar input output
  </code></pre>
  
  <p>And no matter where I put the -D I can't get the value via System.getProperty(...). The properties is not set. The hadoop documentation said that -D is a GENERIC OPTION and is set after the command. But if I do so I get an error that -D is not a valid jar file (duh...)</p>
  
  <p>I aim to keep the application as clean as possible...so I only want to pass the user configuration as a parameter as a last resort, i.e.</p>
  
  <pre><code>/bin/hadoop jar MyAwesomeApp.jar input output user.properties
  </code></pre>
  
  <p>I hope someone can tell me what I have to do to get the -D working :/
  Hadoop is running pseudo distributed so I am actually using HDFS too...</p>