title: How to set different path in build.xml
body: <p>I want to put path of different directory (which contains jars, presently on <code>d:/ext_jars</code>).
  After running the build.xml. I want that path should take that runnable jar.</p>
  
  <p>Currently that jar is giving me errors because of classpath is not present (which was previously under <code>c:/project/lib/*.jars</code>, converted into <code>D:/ext_jars</code>).</p>
  
  <p>Please help me, that how can I set that external directory in classpath of build.xml?</p>
  
  <hr>
  
  <h2>My code in : build.xml</h2>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;project name="MyProject" default="deploy" basedir="." &gt;
      &lt;property file="manifest.mf" /&gt;
      &lt;property name="dir.src" value="src" /&gt;
      &lt;property name="dir.build" value="bin" /&gt;
      &lt;property name="dir.dist" value="dist/MyProject" /&gt;
      &lt;property name="dir.lib" value="lib" /&gt;
  &lt;!-- Creates the output directories --&gt;
      &lt;target name="prepare"&gt;
          &lt;mkdir dir="${dir.build}" /&gt;
          &lt;mkdir dir="${dir.dist}" /&gt;
  
          &lt;mkdir dir="${dir.dist}/${dir.csvdata}" /&gt;
          &lt;mkdir dir="${dir.dist}/${dir.MH}" /&gt;
      &lt;/target&gt;
  
      &lt;target name="clean" description="Remove all generated files."&gt;
          &lt;delete dir="${dir.build}" /&gt;
          &lt;delete dir="${dir.dist}" /&gt;
      &lt;/target&gt;
  
      &lt;path id="build.classpath"&gt;
          &lt;fileset dir="${dir.lib}"&gt;
              &lt;include name="**/*.jar" /&gt;
              &lt;include name="**/*.zip" /&gt;
          &lt;/fileset&gt;
      &lt;/path&gt;
      &lt;path id="build.classpath.ref"&gt;
          &lt;fileset dir="D:/ext_jars"&gt;
              &lt;include name="**/*.jar" /&gt;
              &lt;include name="**/*.zip" /&gt;
          &lt;/fileset&gt;
      &lt;/path&gt;
  
      &lt;target name="compile" depends="prepare" description="Compile all source code."&gt;
          &lt;!--&lt;javac srcdir="${dir.src}" destdir="${dir.build}" debug="true"&gt;--&gt;
          &lt;javac  destdir="${dir.build}" debug="true"&gt;
              &lt;classpath refid="build.classpath" /&gt;
              &lt;classpath refid="build.classpath.ref" /&gt;
              &lt;src path="src"/&gt;           
          &lt;/javac&gt;        
          &lt;copy todir="${dir.build}"&gt;
              &lt;fileset dir="${dir.src}"&gt;
                  &lt;exclude name="**/*.java" /&gt;
              &lt;/fileset&gt;
          &lt;/copy&gt;     
      &lt;/target&gt;
  
      &lt;pathconvert property="classpath" refid="build.classpath"&gt;
      &lt;/pathconvert&gt;
      &lt;pathconvert property="classpath" refid="build.classpath.ref"&gt;
      &lt;/pathconvert&gt;
  
      &lt;target name="jar" depends="compile" description="Generates ${project.name}.Jar in the 'dist' directory."&gt;
          &lt;jar jarfile="${dir.dist}/${ant.project.name}.jar"&gt;
              &lt;fileset dir="${dir.build}" includes="**/*.*" /&gt;
              &lt;manifest&gt;
                  &lt;attribute name="Class-Path" value="${Class-Path}" /&gt;
                  &lt;attribute name="Main-Class" value="${Main-Class}" /&gt;
              &lt;/manifest&gt;
          &lt;/jar&gt;
      &lt;/target&gt;
      &lt;target name="deploy" depends="clean,jar"&gt;
          &lt;copy todir="${dir.dist}/${dir.lib}"&gt;
              &lt;fileset dir="${dir.lib}"&gt;
                  &lt;include name="**/*.jar" /&gt;
                  &lt;include name="**/*.zip" /&gt;
              &lt;/fileset&gt;
          &lt;/copy&gt;
      &lt;/target&gt;
  </code></pre>
  
  <h2>    </h2>
  
  <p>Using this code After runing project it is running well, But after running jar created by this code it is not running it is throughing error as follows:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: dowlibpkg/DowLib
          at mypkg.MainApp.main(MainApp.java:109)
  Caused by: java.lang.ClassNotFoundException: dowlibpkg.DowLib
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          ... 1 more
  </code></pre>
  
  <p>SO created Jar is not running../ I want it to be run, can any one please help me</p>
  
  <p>==============================================================</p>
  
  <h2>manifest.mf</h2>
  
  <p>Manifest-Version: 1.0
  Class-Path: lib/org.springframework.asm-3.0.1.RELEASE \ lib/org.springframework.beans-3.0.1.RELEASE \ lib/org.springframework.context-3.0.1.RELEASE \ lib/org.springframework.core-3.0.1.RELEASE \ lib/org.springframework.expression-3.0.1.RELEASE \ lib/org.springframework.oxm-3.0.1.RELEASE \ lib/org.springframework.web-3.0.1.RELEASE 
  Main-Class: myProject.MainApp</p>