<javac srcdir="${src}" destdir="${build}"/>
    <classpath>
        <pathelement
location="/progs/jakarta-tomcat-5.5.9/common/lib/servlet-api.jar"/>
    </classpath> 

you closed your "javac" tag (xml empty tag syntax with a closing "/"),
so your classpath isn't being passed.

/t

>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
>Sent: Saturday, September 03, 2005 9:36 AM
>To: user@ant.apache.org
>Subject: classpath problem
>
>Hi.
>
>I've searched for a solution on this list, faq and google.
>It's probably very simple. I am a beginner with ant.
>
>I want to compile some files that are part of a webapp.
>So they need the servlet-api.jar file.
>
>When I run ant with the following build.xml file it can't find the
>javax.servlet.* classes.
>
>I've added a <classpath> element as below.
>What am I doing wrong?
>
>/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
><project name="megaboard01" default="dist" basedir=".">
>    <description>
>        simple example build file
>    </description>
>  <!-- set global properties for this build -->
>  <property name="src" location="../megaboard02/src/java"/>
>  <property name="build" location="build"/>
>  <property name="dist"  location="dist"/>
>
>  <target name="init">
>    <!-- Create the time stamp -->
>    <tstamp/>
>    <!-- Create the build directory structure used by compile -->
>    <mkdir dir="${build}"/>
>  </target>
>
>  <target name="compile" depends="init"
>        description="compile the source " >
>    <!-- Compile the java code from ${src} into ${build} -->
>    <javac srcdir="${src}" destdir="${build}"/>
>        <classpath>
>               <pathelement 
>location="/progs/jakarta-tomcat-5.5.9/common/lib/servlet-api.jar"/>
>        </classpath>
>  </target>
>
>  <target name="dist" depends="compile"
>        description="generate the distribution" >
>    <!-- Create the distribution directory -->
>    <mkdir dir="${dist}/lib"/>
>
>    <!-- Put everything in ${build} into the 
>MyProject-${DSTAMP}.jar file -->
>    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" 
>basedir="${build}"/>
>  </target>
>
>  <target name="clean"
>        description="clean up" >
>    <!-- Delete the ${build} and ${dist} directory trees -->
>    <delete dir="${build}"/>
>    <delete dir="${dist}"/>
>  </target>
></project>
>\_________
>
>
>Thanks.
>Kind regards.
>Luke.
>-- 
>............._..
>.|  .| |.|/.|_ .
>.|__.|_|.|\.|_ .
>:61 421 276 282:
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to