title: Hadoop command line -D options not working
body: <p>I am trying to pass a variable (not property) using -D command line option in hadoop like <code>-Dmapred.mapper.mystring=somexyz</code>. I am able to set a conf property in Driver program and read it back in mapper. 
  So I can use this to pass my string as additional parameter and set it in Driver. But I want to see if -D option can be used to do the same</p>
  
  <p>My command is:</p>
  
  <pre><code>$HADOOP_HOME/bin/hadoop jar  /home/hduser/Hadoop_learning_path/toolgrep.jar /home/hduser/hadoopData/inputdir/ /home/hduser/hadoopData/grepoutput -Dmapred.mapper.mystring=somexyz
  </code></pre>
  
  <p>Driver program</p>
  
  <pre><code>String s_ptrn=conf.get("mapred.mapper.regex");
  </code></pre>
  
  <p>System.out.println("debug: in Tool Class mapred.mapper.regex "+s_ptrn + "\n");
  Gives NULL</p>
  
  <p>BUT this works </p>
  
  <pre><code>conf.set("DUMMYVAL","100000000000000000000000000000000000000"); in driver is read properly in mapper by get method. 
  </code></pre>
  
  <p>My question is if all of Internet is saying i can use -D option then why cant i? is it that this cannot be used for any argument and only for properties? whihc we can read by putitng in file that i should read in driver program then use it?</p>
  
  <p>Something like</p>
  
  <pre><code>Configuration conf = new Configuration();
  conf.addResource("~/conf.xml"); 
  </code></pre>
  
  <p>in driver program and this is the only way.</p>