title: ANT: How to modify java.library.path in a buildfile
body: <p>The java.library.path property appears to be read-only. For example when you run ant on the following buildfile</p>
  
  <pre><code>&lt;project name="MyProject" default="showprops" basedir="."&gt;
      &lt;property name="java.library.path" value="test"/&gt;
      &lt;property name="some.other.property" value="test1"/&gt;
      &lt;target name="showprops"&gt;
          &lt;echo&gt;java.library.path=${java.library.path}&lt;/echo&gt;
          &lt;echo&gt;some.other.property=${some.other.property}&lt;/echo&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>you get</p>
  
  <pre><code>&gt; ant -version
  Apache Ant version 1.6.5 compiled on June 2 2005
  
  &gt; ant -Djava.library.path=commandlinedefinedpath
  Buildfile: build.xml
  showprops:
      [echo] java.library.path=commandlinedefinedpath
      [echo] some.other.property=test1
  BUILD SUCCESSFUL
  Total time: 0 seconds
  </code></pre>
  
  <p>The output indicates that the <strong>java.library.path</strong> hasn't been changed, but             <strong>some.other.property</strong> was set correctly. </p>
  
  <p>I would like to know how to modify the java.library.path within a buildfile. Specifying the java.library.path on the ant command line is not really an easy option, because the library path location is not know at that time.</p>
  
  <p>Note: I would like this to work so that I can specify the location of native libraries used in a unit test. </p>