On 03/09/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > 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] > > Probably you have to enlose the <classpath> tag in your <javac> tag like this: <javac BLAH BLAH> <classpath> BLAH BLAH </classpath> </javac>
-- Regards, Petar!