title: How to set system environment variable from Mapper Hadoop?
body: <p><strong>The problem below the line is solved but I am facing another problem.</strong></p>
  
  <p>I am doing this :</p>
  
  <pre><code>DistributedCache.createSymlink(job.getConfiguration()); 
  DistributedCache.addCacheFile(new URI   
  ("hdfs:/user/hadoop/harsh/libnative1.so"),conf.getConfiguration()); 
  </code></pre>
  
  <p>and in the mapper :</p>
  
  <pre><code>System.loadLibrary("libnative1.so");
  </code></pre>
  
  <p>(i also tried 
  System.loadLibrary("libnative1");
  System.loadLibrary("native1");</p>
  
  <p>But I am getting this error:</p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: no libnative1.so in java.library.path
  </code></pre>
  
  <p>I am totally clueless what should I set java.library.path to ..
  I tried setting it to /home and copied every .so from distributed cache to /home/ but still it didn't work :(</p>
  
  <p>Any suggestions / solutions please?</p>
  
  <p><strike>IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII</strike></p>
  
  <p>I want to set the system environment variable (specifically, LD_LIBRARY_PATH) of the machine where the mapper is running.</p>
  
  <p>I tried :</p>
  
  <pre><code>Runtime run = Runtime.getRuntime();
  Process pr=run.exec("export LD_LIBRARY_PATH=/usr/local/:$LD_LIBRARY_PATH");
  </code></pre>
  
  <p>But it throws IOException.</p>
  
  <p>I also know about </p>
  
  <pre><code>JobConf.MAPRED_MAP_TASK_ENV
  </code></pre>
  
  <p>But I am using hadoop version 0.20.2 which has Job &amp; Configuration instead of JobConf.</p>
  
  <p>I am unable to find any such variable, and this is also not a Hadoop specific environment variable but a system environment variable.</p>
  
  <p>Any solution/suggestion?
  Thanks in advance..    </p>