In the first place you must observe that the versions are compatible.
The eclipse that I recommend to you is 3.1.2 version download it, and then configure the JRE. (C:\Program Files\Java\jdk1.5 .0_01 \ jre), it must be the same one of the tomcat (I used jakarta-tomcat-5.5.9.exe version), is configured when tomcat5 installs. Finally you must construct build.xml and do deploy…
this is an example
<project name="out0" basedir="../" default="copywar">
<!-- Project settings -->
<property name="project.distname" value="out0"/>
<!-- Local system paths -->
<property file="${basedir}/ant/build.properties"/>
<property name="webroot.dir" value="${basedir}/WebContent"/>
<property name="webinf.dir" value="${webroot.dir}/WEB-INF"/>
<property name="build.dir" value="build"/>
<!-- classpath for JSF 1.0 -->
<path id="compile.classpath">
<pathelement path ="${webinf.dir}/lib/commons-beanutils.jar"/>
<pathelement path ="${webinf.dir}/lib/commons-collections.jar"/>
<pathelement path ="${webinf.dir}/lib/commons-digester.jar"/>
<pathelement path ="${webinf.dir}/lib/commons-logging.jar"/>
<pathelement path ="${webinf.dir}/lib/jsf-api.jar"/>
<pathelement path ="${webinf.dir}/lib/jsf-impl.jar"/>
<pathelement path ="${webinf.dir}/lib/jstl.jar"/>
<pathelement path ="${webinf.dir}/lib/standard.jar"/>
<pathelement path ="${webinf.dir}/classes"/>
<pathelement path ="${classpath.external}"/>
<pathelement path ="${classpath}"/>
</path>
<!-- define your folder for deployment -->
<property name="deploy.dir" value="deploy"/>
<!-- Local system paths -->
<property file="${basedir}/ant/build.properties"/>
<property name="webroot.dir" value="${basedir}/WebContent"/>
<property name="webinf.dir" value="${webroot.dir}/WEB-INF"/>
<property name="build.dir" value="build"/>
<!-- Check timestamp on files -->
<target name="prepare">
<tstamp/>
</target>
<!-- Copy any resource or configuration files -->
<target name="resources">
<copy todir="${webinf.dir}/classes" includeEmptyDirs="no">
<fileset dir="JavaSource">
<patternset>
<include name="**/*.conf"/>
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</patternset>
</fileset>
</copy>
</target>
<!-- Normal build of application -->
<target name="compile" depends="prepare,resources">
<javac srcdir="JavaSource" destdir="${webinf.dir}/classes">
<classpath refid="compile.classpath"/>
</javac>
</target>
<!-- Remove classes directory for clean build -->
<target name="clean"
description="Prepare for clean build">
<delete dir="${webinf.dir}/classes"/>
<mkdir dir="${webinf.dir}/classes"/>
</target>
<!-- Build entire project -->
<target name="build" depends="prepare,compile"/>
<target name="rebuild" depends="clean,prepare,compile"/>
<!-- Create binary distribution -->
<target name="war" depends="build">
<mkdir dir="${build.dir}"/>
<war
basedir="${webroot.dir}"
warfile="${build.dir}/${project.distname}.war"
webxml="${webinf.dir}/web.xml">
<exclude name="WEB-INF/${build.dir}/**"/>
<exclude name="WEB-INF/src/**"/>
<exclude name="WEB-INF/web.xml"/>
</war>
</target>
<target name="deploy" depends="war">
<delete file="${deploy.dir}/${project.distname}.war"/>
<delete dir="${deploy.dir}/${project.distname}"/>
<copy file="${build.dir}/${project.distname}.war" todir="${deploy.dir}"/>
</target>
<target name="copywar" depends="deploy">
<copyfile dest="D:/Tomcat5/webapps/${project.distname}.war" src="${build.dir}/${project.distname}.war"/>
</target>
</project>
Albert