I am new to using ANT and am trying to include third party jars in the build using Eclipse 3.5. I keep getting "cannot find symbol" errors in the compilation, so obviously it is not taking these two jars into consideration. If anyone can show me where I am going wrong, or suggest another route, I would appreciate it. Thanks.
JarPath below is the path to my project in the Eclipse workspace. It tried '/' and '\' in the path and neither mattered.
<?xml version="1.0" ?>
<project default="main">
<property name="env.JAVA_HOME" location="C:\Program Files\Java\jdk\bin\javac.exe"/>
<property name="jars.dir" location="JarPath"/>
<target name="main" depends="compile, compress" description="Main target">
<echo>
Building the .jar file.
</echo>
</target>
<target name="compile" description="Compilation target">
<javac srcdir="." fork="yes" executable="${env.JAVA_HOME}"/>
<classpath>
<pathelement location="${jars.dir}/A.jar"/>
<pathelement location="${jars.dir}/B.jar"/>
</classpath>
</target>
<target name="compress" description="Compression target">
<jar jarfile="MyJar.jar" basedir="." includes="*.class" />
</target>
</project>