私はANTを初めて使用しており、Eclipse 3.5を使用してサードパーティ製のjarをビルドに組み込もうとしています。私はコンパイルで "シンボルを見つけることができません"というエラーが出てくるので、明らかにこの2つのジャーを考慮に入れていません。誰かが私が間違っている場所を私に見せたり、別のルートを提案したりすることができたら、私はそれを感謝します。サードパーティ製のJARを含むANT
以下のJarPathは、Eclipseワークスペース内のプロジェクトへのパスです。パスで '/'と '\'を試してみましたが、どちらも重要ではありませんでした。
<?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>
ありがとうございます。 1つの問題は、classpathタグがjavacタグ内にないことに気づいた場合でした。一度私はそこにそれをコンパイルして移動します。あなたの方法でもコンパイルされます。 – Ken