I have a project in Java I am running that uses an external JAR file
<p>I have a project in Java I am running that uses an external JAR file.</p>

<p>In Eclipse I added the JAR file to the class build path and everything working fine.</p>

<p>But my question is: how can I add it to my project after I created the executable JAR (myPtog.jar)
and I am running "ant" in cmd but the external jar file is not found?</p>

<p>This is my build.xml:</p>

<pre><code>&lt;project name="" default="dist" basedir="."&gt;
    &lt;description&gt;
        Ant
    &lt;/description&gt;

    &lt;!-- Set global properties for this build. --&gt;
    &lt;property name="src" location="src"/&gt;
    &lt;property name="build" location="target"/&gt;

    &lt;target name="init"&gt;
        &lt;tstamp/&gt;
        &lt;mkdir dir="${build}"/&gt;
    &lt;/target&gt;

    &lt;target name="compile" depends="init" description="compile the source "&gt;
        &lt;javac srcdir="${src}" destdir="${build}"/&gt;
    &lt;/target&gt;

    &lt;target name="dist" depends="compile" description="generate the distribution"&gt;
        &lt;jar jarfile="TPCServer.jar" basedir="${build}"&gt;
            &lt;manifest&gt;
                &lt;attribute name="Main-Class" value="Main1"/&gt;
            &lt;/manifest&gt;
        &lt;/jar&gt;
    &lt;/target&gt;

    &lt;target name="clean" description="clean up"&gt;
        &lt;delete dir="${build}"/&gt;
        &lt;delete dir="${dist}"/&gt;
    &lt;/target&gt;
&lt;/project&gt;
</code></pre>
