If you want to run an Ant build within the Eclipse environment, you can launch Eclipse headless as follows:
@echo off
setlocal
set JAVA="c:\esidev\jdk1.5.0_06\bin\java.exe"
set ECLIPSE="c:\esidev\eclipse3.1.x\startup.jar"
set WORKSPACE="c:\work\workspace"
set BUILDFILE="%WORKSPACE%\esi.environment utilities\rebuild-all.ant.xml"
@echo on
%JAVA% ^
-cp %ECLIPSE% ^
org.eclipse.core.launcher.Main ^
-application org.eclipse.ant.core.antRunner ^
-data %WORKSPACE% ^
-buildfile %BUILDFILE% ^
%*
This can come in handy if the Ant script uses some of the Eclipse tasks or if the build relies upon Eclipse's built-in build processes.