title: Include JAR file in ant compilation
body: <p>I want to compile some <code>.java</code> files into a JAR. I would like to use this JAR file in another application.</p>
  
  <p>Is this a good way to use functions from my first application in my second application? My goal is to not duplicate code.</p>
  
  <p>How can I edit the <code>build.xml</code> file for the second application to include the JAR file I created? When I compile my project, functions from JAR files are not resolved :</p>
  
  <pre><code>[javac] C:\HelloWorld\src\com\example\helloworld\HelloWorld.java:7: 
          package TOOLS does not exist  
  [javac] import TOOLS.Logs;
  </code></pre>
  
  <hr>
  
  <p>EDIT:<br>
  When I add the <code>javac</code> task in my <code>build.xml</code>, compilation fails because other packages are not found:</p>
  
  <pre><code>[javac] Compiling 1 source file
  [javac] C:\HelloWorld\src\com\example\hellowolrd\HelloWorld.java:3: 
          package android.app does not exist
  [javac] import android.app.Activity;
  [javac]                   ^
  </code></pre>
  
  <p>Why are my original packages not found after I include the JAR file?</p>