Ant question

D

deepstar

Hey all

I have a simple app which requires a couple of jar files residing in
it's /lib directory. I'm trying to compile the app using Ant (i'm a Ant
newbie) but it complains that it can't find my jar files, how can I
make Ant aware of the jars in my /lib directory when using it to
compile my project?

Here's my short build.xml

<?xml version="1.0"?>
<project name="test" default="compile" basedir=".">

<property name="src" value="src"/>
<property name="build" value="build"/>

<target name="init">
<mkdir dir="${build}"/>
</target>

<target name="compile" depends="init">
<!-- Compile the java code -->

<javac srcdir="${src}" destdir="${build}"/>
</target>
</project>


Thanks!
 
L

Larry

Try putting your JAR path/filename into the "classpath" arttibute
(you'll need to add it) to your javac block:

<javac srcdir="${devel.home}/src"
destdir="${build.devel}"
includes="com/**"
classpath="c:/lib/my.jar"
debug="on"
optimize="off"
deprecation="off"/>

This should allow ANT to find your JAR.

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top