There are several ways to run Ant scripts :
1). You can download Ant from the Apache Ant website (http://ant.apache.org), install as directed in the Ant documentation, add the Ant executable to your path and then run:
$ ant -f build.xml
where "build.xml" is your build configuration file.
Check the "Software Requirements" and "Configuring Ant" sections of the applicable product's Installation Guide to find the Apache Ant version and configuration required.
2). You may also use the following command to run Ant that is embedded in ActiveMatrix Platform:
$ java -Xmx1024m -XX:MaxPermSize=256m -XX:PermSize=128m -jar <tibco_home>/components/shared/1.0.0/plugins/com.tibco.tpcl.org.apache.tools.ant_<version>/ant-launcher.jar -f build.xml
or
$java -Xmx1024m -XX:MaxPermSize=256m -XX:PermSize=128m -cp <tibco_home>/tools/lib/antpackage.jar org.apache.tools.ant.Main -f build.xml
Make sure that Java is pointing to the JDK/bin folder and not JRE (it needs tools.jar to run).