You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

install.html 29 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <link rel="stylesheet" type="text/css" href="stylesheets/style.css">
  5. <title>Installing Ant</title>
  6. </head>
  7. <body>
  8. <h1>Installing Ant</h1>
  9. <h2><a name="getting">Getting Ant</a></h2>
  10. <h3>Binary Edition</h3>
  11. <p>The latest stable version of Ant is available from the Ant web page <a
  12. href="http://ant.apache.org/">http://ant.apache.org/</a>.
  13. If you like living on the edge, you can download the latest version from <a
  14. href="http://cvs.apache.org/builds/ant/nightly/">http://cvs.apache.org/builds/ant/nightly/</a>.</p>
  15. <h3>Source Edition</h3>
  16. <p>If you prefer the source edition, you can download the source for the latest Ant release from <a href="http://ant.apache.org/srcdownload.cgi">http://ant.apache.org/srcdownload.cgi</a>.
  17. Again, if you prefer the edge, you can access
  18. the code as it is being developed via CVS. The Jakarta website has details on
  19. <a href="http://jakarta.apache.org/site/cvsindex.html" target="_top">accessing CVS</a>. Please checkout the
  20. ant module.
  21. See the section <a href="#buildingant">Building Ant</a> on how to
  22. build Ant from the source code.
  23. You can also access the
  24. <a href="http://cvs.apache.org/viewcvs/ant/" target="_top">
  25. Ant CVS repository</a> on-line. </p>
  26. <hr>
  27. <h2><a name="sysrequirements">System Requirements</a></h2>
  28. Ant has been used successfully on many platforms, including Linux,
  29. commercial flavours of Unix such as Solaris and HP-UX,
  30. Windows 9x and NT, OS/2 Warp, Novell Netware 6, OpenVMS and MacOS X.
  31. The platforms used most for development are, in no particular order,
  32. Linux, MacOS X, Windows XP and Unix; these are therefore that platforms
  33. that work best.
  34. <p>
  35. To build and use Ant, you must have a JAXP-compliant XML parser installed and
  36. available on your classpath.</p>
  37. <p>
  38. The binary distribution of Ant includes the latest version of the
  39. <a href="http://xml.apache.org/xerces2-j/index.html">Apache Xerces2</a> XML parser.
  40. Please see
  41. <a href="http://java.sun.com/xml/" target="_top">http://java.sun.com/xml/</a>
  42. for more information about JAXP.
  43. If you wish to use a different JAXP-compliant parser, you should remove
  44. <code>xercesImpl.jar</code> and <code>xml-apis.jar</code>
  45. from Ant's <code>lib</code> directory.
  46. You can then either put the jars from your preferred parser into Ant's
  47. <code>lib</code> directory or put the jars on the system classpath.
  48. Some parts of Ant will fail if you use an old parser, especially one
  49. that is not namespace-aware. In particular, avoid the Crimson parser.</p>
  50. <p>Tip: "ant -diagnostics" will list the XML parser used and its location.</p>
  51. <p>
  52. For the current version of Ant, you will also need a JDK installed on
  53. your system, version 1.2 or later.
  54. </p>
  55. <p>
  56. <strong>Note #2: </strong>If a JDK is not present, only the JRE runtime, then many tasks will not work.
  57. </p>
  58. <hr>
  59. <h2><a name="installing">Installing Ant</a></h2>
  60. <p>The binary distribution of Ant consists of the following directory layout:
  61. <pre>
  62. ant
  63. +--- README, LICENSE, fetch.xml, other text files. //basic information
  64. +--- bin // contains launcher scripts
  65. |
  66. +--- lib // contains Ant jars plus necessary dependencies
  67. |
  68. +--- docs // contains documentation
  69. | +--- ant2 // a brief description of ant2 requirements
  70. | |
  71. | +--- images // various logos for html documentation
  72. | |
  73. | +--- manual // Ant documentation (a must read ;-)
  74. |
  75. +--- etc // contains xsl goodies to:
  76. // - create an enhanced report from xml output of various tasks.
  77. // - migrate your build files and get rid of 'deprecated' warning
  78. // - ... and more ;-)
  79. </pre>
  80. Only the <code>bin</code> and <code>lib</code> directories are
  81. required to run Ant.
  82. To install Ant, choose a directory and copy the distribution
  83. file there. This directory will be known as ANT_HOME.
  84. </p>
  85. <table width="80%">
  86. <tr>
  87. <td colspan="2">
  88. <b>Windows 95, Windows 98 &amp; Windows ME Note:</b>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td width="5%">&nbsp;</td>
  93. <td><i>
  94. On these systems, the script used to launch Ant will have
  95. problems if ANT_HOME is a long filename (i.e. a filename which is not
  96. of the format known as &quot;8.3&quot;). This is due to
  97. limitations in the OS's handling of the <code>&quot;for&quot;</code>
  98. batch-file statement. It is recommended, therefore, that Ant be
  99. installed in a <b>short</b>, 8.3 path, such as C:\Ant. </i>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td width="5%">&nbsp;</td>
  104. <td>
  105. <p>On these systems you will also need to configure more environment
  106. space to cater for the environment variables used in the Ant lauch script.
  107. To do this, you will need to add or update the following line in
  108. the <code>config.sys</code> file
  109. </p>
  110. <p><code>shell=c:\command.com c:\ /p /e:32768</code></p>
  111. </td>
  112. </tr>
  113. </table>
  114. <h3>Setup</h3>
  115. <p>
  116. Before you can run Ant there is some additional set up you
  117. will need to do unless you are installing the <a href="#jpackage">RPM
  118. version from jpackage.org</a>:</p>
  119. <ul>
  120. <li>Add the <code>bin</code> directory to your path.</li>
  121. <li>Set the <code>ANT_HOME</code> environment variable to the
  122. directory where you installed Ant. On some operating systems the ant
  123. wrapper scripts can guess <code>ANT_HOME</code> (Unix dialects and
  124. Windows NT/2000), but it is better to not rely on this behavior.</li>
  125. <li>Optionally, set the <code>JAVA_HOME</code> environment variable
  126. (see the <a href="#advanced">Advanced</a> section below).
  127. This should be set to the directory where your JDK is installed.</li>
  128. </ul>
  129. <p><strong>Note:</strong> Do not install Ant's ant.jar file into the lib/ext
  130. directory of the JDK/JRE. Ant is an application, whilst the extension
  131. directory is intended for JDK extensions. In particular there are security
  132. restrictions on the classes which may be loaded by an extension.</p>
  133. <h3><a name="optionalTasks">Optional Tasks</a></h3>
  134. <p>Ant supports a number of optional tasks. An optional task is a task which
  135. typically requires an external library to function. The optional tasks are
  136. packaged together with the core Ant tasks.</p>
  137. <p>The external libraries required by each of the optional tasks is detailed
  138. in the <a href="#librarydependencies">Library Dependencies</a> section. These external
  139. libraries may either be placed in Ant's lib directory, where they will be picked up
  140. automatically.
  141. </p>
  142. <h3><a name="classpath">The CLASSPATH environment variable</a></h3>
  143. <p>
  144. The CLASSPATH environment variable is a source of many Ant support queries. As
  145. the round trip time for diagnosis on the Ant user mailing list can be slow, and
  146. because filing bug reports complaining about 'ant.bat' not working will be
  147. rejected by the developers as WORKSFORME "this is a configuration problem, not a
  148. bug", you can save yourself a lot of time and frustration by following some
  149. simple steps.
  150. </p>
  151. <ol>
  152. <li>Do not ever set CLASSPATH. Ant does not need it, it only causes confusion
  153. and breaks things.
  154. </li>
  155. <li>If you ignore the previous rule, do not ever, ever, put quotes in the
  156. CLASSPATH, even if there is a space in a directory. This will break Ant, and it
  157. is not needed. </li>
  158. <li>If you ignore the first rule, do not ever, ever, have a trailing backslash
  159. in a CLASSPATH, as it breaks Ant's ability to quote the string. Again, this is
  160. not needed for the correct operation of the CLASSPATH environment variable, even
  161. if a DOS directory is to be added to the path. </li>
  162. <li>You can stop Ant using the CLASSPATH environment variable by setting the
  163. <code>-noclasspath</code> option on the command line.</li>
  164. </ol>
  165. <p>
  166. The usual symptom of CLASSPATH problems is that ant will not run with some error
  167. about not being able to find org.apache.tools.Ant.main, or, if you have got the
  168. quotes/backslashes wrong, some very weird Java startup error. To see if this is
  169. the case, run <code>ant -noclasspath</code> or unset the CLASSPATH environment
  170. variable.
  171. </p>
  172. <h3><a name="proxy">Proxy Configuration</a></h3>
  173. <p> Many Ant built-in and third-party tasks use network connections to retrieve
  174. files from HTTP servers. If you are behind a firewall with a proxy server, then
  175. Ant needs to be configured with the proxy. Here are the different ways to do
  176. this. </p>
  177. <ul>
  178. <li><b>With Java1.5</b><br>.
  179. When you run Ant on Java1.5, it tries to use the automatic proxy setup
  180. mechanism. If this works -and it is a big if, as we see little evidence of it
  181. doing so on Linux or WinXP, then your proxy is set up without you doing
  182. anything. You can disable this feature with the <code>-noproxy</code> option.
  183. </li>
  184. <li><b>With explicit JVM properties.</b><br>.
  185. These are documented <a
  186. href="http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html">by Sun</a>,
  187. and control the proxy behaviour of the entire JVM. To set them in Ant, declare
  188. them in the <code>ANT_OPTS</code> environment variable. This is the best option
  189. for a non-mobile system. For a laptop, you have to change these settings as you
  190. roam.
  191. </li>
  192. <li><b>In the build file itself</b><br>
  193. If you are writing an build file that is always to be used behind the firewall,
  194. the &lt;setproxy&gt; task lets you configure the proxy (which it does by setting
  195. the JVM properties). If you do this, we strongly recommend using ant properties
  196. to define the proxy host, port, etc, so that individuals can override the
  197. defaults.</li>
  198. </ul>
  199. <p> The Ant team acknowledges that this is unsatisfactory. Until the JVM
  200. automatic proxy setup works properly everywhere, explicit JVM options via
  201. ANT_ARGS are probably the best solution. Note that setting properties on Ant's
  202. command line do not work, because those are <i>Ant properties</i> being set, not
  203. JVM options. This means the following does not set up the command line:
  204. </p>
  205. <pre>ant -Dhttp.proxyHost=proxy -Dhttp.proxyPort=81</pre>
  206. <p> All it does is set up two Ant properties.</p> <p>One other troublespot with
  207. proxies is with authenticating proxies. Ant cannot go beyond what the JVM does
  208. here, and as it is very hard to remotely diagnose, test and fix proxy-related
  209. problems, users who work behind a secure proxy will have to spend much time
  210. configuring the JVM properties until they are happy. </p>
  211. <h3><a name="windows">Windows and OS/2</a></h3>
  212. <p>Assume Ant is installed in <code>c:\ant\</code>. The following sets up the
  213. environment:</p>
  214. <pre>set ANT_HOME=c:\ant
  215. set JAVA_HOME=c:\jdk-1.5.0.05
  216. set PATH=%PATH%;%ANT_HOME%\bin</pre>
  217. <h3>Linux/Unix (bash)</h3>
  218. <p>Assume Ant is installed in <code>/usr/local/ant</code>. The following sets up
  219. the environment:</p>
  220. <pre>export ANT_HOME=/usr/local/ant
  221. export JAVA_HOME=/usr/local/jdk-1.5.0.05
  222. export PATH=${PATH}:${ANT_HOME}/bin</pre>
  223. <h3>Linux/Unix (csh)</h3>
  224. <pre>setenv ANT_HOME /usr/local/ant
  225. setenv JAVA_HOME /usr/local/jdk/jdk-1.5.0.05
  226. set path=( $path $ANT_HOME/bin )</pre>
  227. <p>
  228. Having a symbolic link set up to point to the JVM/JSK version makes updates more seamless. </p>
  229. <a name="jpackage"></a>
  230. <h3>RPM version from jpackage.org</h3>
  231. <p>
  232. The <a href="www.jpackage.org">JPackage project</a> distributes an RPM version of Ant.
  233. With this version, it is not necessary to set <code> JAVA_HOME </code>or
  234. <code> ANT_HOME </code>environment variables and the RPM installer will correctly
  235. place the Ant executable on your path. The <code> ANT_HOME </code>environment variable will
  236. be ignored, if set, when running the JPackage version of Ant.
  237. </p><p>
  238. Optional jars for the JPackage version are handled in two ways. The easiest, and
  239. best way is to get these external libraries from JPackage if JPackage has them
  240. available. (Note: for each such library, you will have to get both the external
  241. package itself (e.g. <code>oro-2.0.8-2jpp.noarch.rpm</code>) and the small library that links
  242. ant and the external package (e.g. <code>ant-apache-oro-1.6.2-3jpp.noarch.rpm</code>).
  243. </p><p>
  244. However, JPackage does not package proprietary software, and since some of the
  245. optional packages depend on proprietary jars, they must be handled as follows.
  246. This may violate the spirit of JPackage, but it is necessary if you need these proprietary packages.
  247. For example, suppose you want to install support for starteam, which jpackage does not
  248. support:
  249. <ol>
  250. <li>Decide where you want to deploy the extra jars. One option is in <code>$ANT_HOME/lib</code>,
  251. which, for JPackage is usually <code>/usr/share/ant/lib</code>. Another, less messy option
  252. is to create an <code>.ant/lib</code> subdirectory of your home directory and place your
  253. non-jpackage ant jars there, thereby avoiding mixing jpackage
  254. libraries with non-jpacakge stuff in the same folder. More information on where Ant finds its libraries is available
  255. <a href="http://ant.apache.org/manual/running.html#libs">here</a></li>
  256. <li>Download a non-jpackage binary distribution from the regular <a href="http://ant.apache.org/bindownload.cgi">Apache Ant site</a></li>
  257. <li>Unzip or untar the distribution into a temporary directory</li>
  258. <li>Copy the linking jar, in this case <code>ant-starteam.jar</code>, into the library directory you
  259. chose in step 1 above.</li>
  260. <li>Copy the proprietary jar itself into the same directory.</li>
  261. </ol>
  262. Finally, if for some reason you are running on a system with both the JPackage and Apache versions of Ant
  263. available, if you should want to run the Apache version (which will have to be specified with an absolute file name,
  264. not found on the path), you should use Ant's <code>--noconfig</code> command-line switch to avoid JPackage's classpath mechanism.
  265. <h3><a name="advanced">Advanced</a></h3>
  266. <p>There are lots of variants that can be used to run Ant. What you need is at
  267. least the following:</p>
  268. <ul>
  269. <li>The classpath for Ant must contain <code>ant.jar</code> and any jars/classes
  270. needed for your chosen JAXP-compliant XML parser.</li>
  271. <li>When you need JDK functionality
  272. (such as for the <a href="CoreTasks/javac.html">javac</a> task or the
  273. <a href="CoreTasks/rmic.html">rmic</a> task), then <code>tools.jar</code>
  274. must be added. The scripts supplied with Ant,
  275. in the <code>bin</code> directory, will add
  276. the required JDK classes automatically, if the <code>JAVA_HOME</code>
  277. environment variable is set.</li>
  278. <li>When you are executing platform-specific applications, such as the
  279. <a href="CoreTasks/exec.html">exec</a> task or the
  280. <a href="CoreTasks/cvs.html">cvs</a> task, the property <code>ant.home</code>
  281. must be set to the directory containing where you installed Ant. Again
  282. this is set by the Ant scripts to the value of the ANT_HOME environment
  283. variable.</li>
  284. </ul>
  285. The supplied ant shell scripts all support an <tt>ANT_OPTS</tt>
  286. environment variable which can be used to supply extra options
  287. to ant. Some of the scripts also read in an extra script stored
  288. in the users home directory, which can be used to set such options. Look
  289. at the source for your platform's invocation script for details.
  290. <hr>
  291. <h2><a name="buildingant">Building Ant</a></h2>
  292. <p>To build Ant from source, you can either install the Ant source distribution
  293. or checkout the ant module from CVS.</p>
  294. <p>Once you have installed the source, change into the installation
  295. directory.</p>
  296. <p>Set the <code>JAVA_HOME</code> environment variable
  297. to the directory where the JDK is installed.
  298. See <a href="#installing">Installing Ant</a>
  299. for examples on how to do this for your operating system. </p>
  300. <p><b>Note</b>: The bootstrap process of Ant requires a greedy
  301. compiler like Sun's javac or jikes. It does not work with gcj or
  302. kjc.</b>
  303. <p>Make sure you have downloaded any auxiliary jars required to
  304. build tasks you are interested in. These should either be available
  305. on the CLASSPATH or added to the <code>lib/optional</code>
  306. directory of the source tree.
  307. See <a href="#librarydependencies">Library Dependencies</a>
  308. for a list of jar requirements for various features.
  309. Note that this will make the auxiliary jars
  310. available for the building of Ant only. For running Ant you will
  311. still need to
  312. make the jars available as described under
  313. <a href="#installing">Installing Ant</a>.</p>
  314. <p>Your are now ready to build Ant:</p>
  315. <blockquote>
  316. <p><code>build -Ddist.dir=&lt;<i>directory_to_contain_Ant_distribution</i>&gt; dist</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  317. <p><code>build.sh -Ddist.dir=&lt;<i>directory_to_contain_Ant_distribution</i>&gt; dist</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  318. </blockquote>
  319. <p>This will create a binary distribution of Ant in the directory you specified.</p>
  320. <p>The above action does the following:</p>
  321. <ul>
  322. <li>If necessary it will bootstrap the Ant code. Bootstrapping involves the manual
  323. compilation of enough Ant code to be able to run Ant. The bootstrapped Ant is
  324. used for the remainder of the build steps. </li>
  325. <li>Invokes the bootstrapped Ant with the parameters passed to the build script. In
  326. this case, these parameters define an Ant property value and specify the &quot;dist&quot; target
  327. in Ant's own <code>build.xml</code> file.</li>
  328. </ul>
  329. <p>On most occasions you will not need to explicitly bootstrap Ant since the build
  330. scripts do that for you. If however, the build file you are using makes use of features
  331. not yet compiled into the bootstrapped Ant, you will need to manually bootstrap.
  332. Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX)
  333. to build a new bootstrap version of Ant.</p>
  334. If you wish to install the build into the current <code>ANT_HOME</code>
  335. directory, you can use:
  336. <blockquote>
  337. <p><code>build install</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  338. <p><code>build.sh install</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  339. </blockquote>
  340. You can avoid the lengthy Javadoc step, if desired, with:
  341. <blockquote>
  342. <p><code>build install-lite</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  343. <p><code>build.sh install-lite</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  344. </blockquote>
  345. This will only install the <code>bin</code> and <code>lib</code> directories.
  346. <p>Both the <code>install</code> and
  347. <code>install-lite</code> targets will overwrite
  348. the current Ant version in <code>ANT_HOME</code>.</p>
  349. <hr>
  350. <h2><a name="librarydependencies">Library Dependencies</a></h2>
  351. <p>The following libraries are needed in Ant's classpath
  352. if you are using the
  353. indicated feature. Note that only one of the regexp libraries is
  354. needed for use with the mappers
  355. (and Java 1.4 and higher includes a regexp implementation which
  356. Ant will find automatically).
  357. You will also need to install the
  358. Ant optional jar containing the task definitions to make these
  359. tasks available. Please refer to the <a href="#optionalTasks">
  360. Installing Ant / Optional Tasks</a> section above.</p>
  361. <table border="1" cellpadding="2" cellspacing="0">
  362. <tr>
  363. <td><b>Jar Name</b></td>
  364. <td><b>Needed For</b></td>
  365. <td><b>Available At</b></td>
  366. </tr>
  367. <tr>
  368. <td>An XSL transformer like Xalan or XSL:P</td>
  369. <td>style task</td>
  370. <td>
  371. <b>If you use JDK 1.4+, an XSL transformer is already included, so you need not do anything special.</b><br>
  372. <ul><li>XALAN : <a href="http://xml.apache.org/xalan-j/index.html"
  373. target="_top">http://xml.apache.org/xalan-j/index.html</a></li>
  374. </ul>
  375. </td>
  376. </tr>
  377. <tr>
  378. <td>jakarta-regexp-1.3.jar</td>
  379. <td>regexp type with mappers</td>
  380. <td><a href="http://jakarta.apache.org/regexp/" target="_top">http://jakarta.apache.org/regexp/</a></td>
  381. </tr>
  382. <tr>
  383. <td>jakarta-oro-2.0.7.jar</td>
  384. <td>regexp type with mappers and the perforce tasks<br>
  385. To use the FTP task,
  386. you need jakarta-oro 2.0.1 or later, and <a href="#commons-net">commons-net</a></td>
  387. <td><a href="http://jakarta.apache.org/oro/" target="_top">http://jakarta.apache.org/oro/</a></td>
  388. </tr>
  389. <tr>
  390. <td>junit.jar</td>
  391. <td>junit tasks</td>
  392. <td><a href="http://www.junit.org/" target="_top">http://www.junit.org/</a></td>
  393. </tr>
  394. <tr>
  395. <td>xalan.jar</td>
  396. <td>junitreport task</td>
  397. <td><a href="http://xml.apache.org/xalan-j/" target="_top">http://xml.apache.org/xalan-j/</a></td>
  398. </tr>
  399. <tr>
  400. <td>stylebook.jar</td>
  401. <td>stylebook task</td>
  402. <td>CVS repository of <a href="http://xml.apache.org/cvs.html" target="_top">http://xml.apache.org/cvs.html</a></td>
  403. </tr>
  404. <tr>
  405. <td>testlet.jar</td>
  406. <td><strong>deprecated</strong> test task</td>
  407. <td>Build from the gzip compress tar archive in <a
  408. href="http://avalon.apache.org/historiccvs/testlet/"
  409. target="_top">http://avalon.apache.org/historiccvs/testlet/</a></td>
  410. </tr>
  411. <tr>
  412. <td>antlr.jar</td>
  413. <td>antlr task</td>
  414. <td><a href="http://www.antlr.org/" target="_top">http://www.antlr.org/</a></td>
  415. </tr>
  416. <tr>
  417. <td >bsf.jar</td>
  418. <td>script task<br>
  419. <strong>Note</strong>: Ant 1.6 and later require Apache BSF, not
  420. the IBM version. I.e. you need BSF 2.3.0-rc1 or later.</td>
  421. <td><a href="http://jakarta.apache.org/bsf/" target="_top">http://jakarta.apache.org/bsf/</a></td>
  422. </tr>
  423. <tr>
  424. <td>Groovy jars</td>
  425. <td>Groovy with script and scriptdef tasks<br>
  426. You need to get the groovy jar and two asm jars from a groovy
  427. installation. The jars are groovy-[version].jar, asm-[vesion].jar and
  428. asm-util-[version].jar. As of groovy version 1.0-beta-7, the jars are
  429. groovy-1.0-beta-7.jar, asm-1.4.3.jar and asm-util-1.4.3.jar.
  430. </td>
  431. <td>
  432. <a href="http://groovy.codehaus.org/">http://groovy.codehaus.org/</a>
  433. <br>
  434. The asm jars are also available from the creators of asm -
  435. <a href="http://asm.objectweb.org/">http://asm.objectweb.org/</a>
  436. </td>
  437. </tr>
  438. <tr>
  439. <td>netrexx.jar</td>
  440. <td>netrexx task, Rexx with the script task</td>
  441. <td><a href="http://www2.hursley.ibm.com/netrexx/" target="_top">
  442. http://www2.hursley.ibm.com/netrexx/</a></td>
  443. </tr>
  444. <tr>
  445. <td>js.jar</td>
  446. <td>Javascript with script task<br>
  447. If you use Apache BSF 2.3.0-rc1, you must use rhino 1.5R3 (later
  448. versions of BSF work with 1.5R4 as well).</td>
  449. <td><a href="http://www.mozilla.org/rhino/" target="_top">http://www.mozilla.org/rhino/</a></td>
  450. </tr>
  451. <tr>
  452. <td>jython.jar</td>
  453. <td>Python with script task<br>
  454. Warning : jython.jar also contains classes from jakarta-oro.
  455. Remove these classes if you are also using jakarta-oro.</td>
  456. <td><a href="http://jython.sourceforge.net/" target="_top">http://jython.sourceforge.net/</a></td>
  457. </tr>
  458. <tr>
  459. <td>jpython.jar</td>
  460. <td>Python with script task <b>deprecated, jython is the prefered engine</b></td>
  461. <td><a href="http://www.jpython.org/" target="_top">http://www.jpython.org/</a></td>
  462. </tr>
  463. <tr>
  464. <td>jacl.jar and tcljava.jar</td>
  465. <td>TCL with script task</td>
  466. <td><a href="http://www.scriptics.com/software/java/" target="_top">http://www.scriptics.com/software/java/</a></td>
  467. </tr>
  468. <tr>
  469. <td>BeanShell JAR(s)</td>
  470. <td>BeanShell with script task.
  471. <br>
  472. <strong>Note</strong>: Ant 1.6 and later require BeanShell version 1.3 or
  473. later</td>
  474. <td><a href="http://www.beanshell.org/" target="_top">http://www.beanshell.org/</a></td>
  475. </tr>
  476. <tr>
  477. <td>jruby.jar</td>
  478. <td>Ruby with script task</td>
  479. <td><a href="http://jruby.sourceforge.net/" target="_top">http://jruby.sourceforge.net/</a></td>
  480. </tr>
  481. <tr>
  482. <td>judo.jar</td>
  483. <td>Judoscript with script task</td>
  484. <td><a href="http://www.judoscript.com/index.html" target="_top">http://www.judoscript.com/index.html</a></td>
  485. </tr>
  486. <tr>
  487. <td>commons-logging.jar</td>
  488. <td>CommonsLoggingListener</td>
  489. <td><a href="http://jakarta.apache.org/commons/logging/index.html"
  490. target="_top">http://jakarta.apache.org/commons/logging/index.html</a></td>
  491. </tr>
  492. <tr>
  493. <td>log4j.jar</td>
  494. <td>Log4jListener</td>
  495. <td><a href="http://jakarta.apache.org/log4j/docs/index.html"
  496. target="_top">http://jakarta.apache.org/log4j/docs/index.html</a></td>
  497. </tr>
  498. <tr>
  499. <td><a name="commons-net">commons-net.jar</td>
  500. <td>ftp, rexec and telnet tasks<br>
  501. jakarta-oro 2.0.1 or later is required in any case together with commons-net.<br>
  502. For all users, a minimum version of commons-net of 1.4.0 is recommended. Earlier
  503. versions did not support the full range of configuration options, and 1.4.0 is needed
  504. to compile Ant.
  505. </td>
  506. <td><a href="http://jakarta.apache.org/commons/net/index.html"
  507. target="_top">http://jakarta.apache.org/commons/net/index.html</a></td>
  508. </tr>
  509. <tr>
  510. <td>bcel.jar</td>
  511. <td>classfileset data type,
  512. JavaClassHelper used by the ClassConstants filter reader and
  513. optionally used by ejbjar for dependency determination
  514. </td>
  515. <td><a href="http://jakarta.apache.org/bcel/" target="_top">http://jakarta.apache.org/bcel/</a></td>
  516. </tr>
  517. <tr>
  518. <td>mail.jar</td>
  519. <td>Mail task with Mime encoding, and the MimeMail task</td>
  520. <td><a href="http://java.sun.com/products/javamail/"
  521. target="_top">http://java.sun.com/products/javamail/</a></td>
  522. </tr>
  523. <tr>
  524. <td>jsse.jar</td>
  525. <td>
  526. Support for SMTP over TLS/SSL <br>
  527. in the Mail task<br>
  528. Already included in jdk 1.4</td>
  529. <td><a href="http://java.sun.com/products/jsse/"
  530. target="_top">http://java.sun.com/products/jsse/</a></td>
  531. </tr>
  532. <tr>
  533. <td>activation.jar</td>
  534. <td>Mail task with Mime encoding, and the MimeMail task</td>
  535. <td><a href="http://java.sun.com/products/javabeans/glasgow/jaf.html"
  536. target="_top">http://java.sun.com/products/javabeans/glasgow/jaf.html</a></td>
  537. </tr>
  538. <tr>
  539. <td>jdepend.jar</td>
  540. <td>jdepend task</td>
  541. <td><a href="http://www.clarkware.com/software/JDepend.html"
  542. target="_top">http://www.clarkware.com/software/JDepend.html</a></td>
  543. </tr>
  544. <tr>
  545. <td>resolver.jar <b>1.1beta or later</b></td>
  546. <td>xmlcatalog datatype <em>only if support for external catalog files is desired</em></td>
  547. <td><a href="http://xml.apache.org/commons/"
  548. target="_top">http://xml.apache.org/commons/</a>.</td>
  549. </tr>
  550. <tr>
  551. <td>jsch.jar</td>
  552. <td>sshexec and scp tasks</td>
  553. <td><a href="http://www.jcraft.com/jsch/index.html"
  554. target="_top">http://www.jcraft.com/jsch/index.html</a></td>
  555. </tr>
  556. <tr>
  557. <td>JAI - Java Advanced Imaging</td>
  558. <td>image task</td>
  559. <td><a href="http://java.sun.com/products/java-media/jai/"
  560. target="_top">http://java.sun.com/products/java-media/jai/</a></td>
  561. </tr>
  562. <tr>
  563. <td>IContract</td>
  564. <td>icontract task<br>
  565. Warning : the icontract jar file contains also antlr classes.<br>
  566. To make the antlr task work properly, remove antlr/ANTLRGrammarParseBehavior.class
  567. from the icontract jar file installed under $ANT_HOME/lib.</td>
  568. <td><a href="http://www.reliable-systems.com/tools/"
  569. target="_top">http://www.reliable-systems.com/tools/</a></td>
  570. </tr>
  571. </table>
  572. <br>
  573. <h2><a name="Troubleshooting">Troubleshooting</a></h2>
  574. <h3><a name="diagnostics">Diagnostics</a></h3>
  575. <p> Ant has a built in diagnostics feature. If you run <code>ant
  576. -diagnostics</code> ant will look at its internal state and print it out. This
  577. code will check and print the following things. </p>
  578. <ul>
  579. <li>The version of ant.jar and ant-optional.jar -and that they match</li>
  580. <li>Which JAR files are int ANT_HOME/lib
  581. <li>Which optional tasks are available. If a task is not listed as being
  582. available, either it is not present, or libraries that it depends on are
  583. absent.</li>
  584. <li>XML Parser information</li>
  585. <li>JVM system properties
  586. </li>
  587. <li>The status of the temp directory. If this is not writeable, or its clock is
  588. horribly wrong (possible if it is on a network drive), a lot of tasks will fail
  589. with obscure error messages.</li>
  590. <li>The current time zone as Java sees it. If this is not what it should be for
  591. your location, then dependency logic may get confused.
  592. </ul>
  593. <p>
  594. Running <code>ant -diagnostics</code> is a good way to check that ant is installed. It is also a first step towards self-diagnosis of any problem. Any configuration problem reported to the user mailing list will probably result ins someone asking you to run the command and show the results, so save time by using it yourself.
  595. </p>
  596. <p>
  597. For under-IDE diagostics, use the &lt;diagnostics&gt; task to run the same tests as an ant task. This can be added to a diagnostics target in a build file to see what tasks are available under the IDE, what the XML parser and classpath is, etc.
  598. </p>
  599. <h3><a name="ant-user">user mailing list</a></h3>
  600. <p> If you cannot get Ant installed or working, the Ant user mailing list is the
  601. best place to start with any problem. Please do your homework first, make sure
  602. that it is not a <a href="classpath">CLASSPATH</a> problem, and run a <a
  603. href="diagnostics">diagnostics check</a> to see what Ant thinks of its own
  604. state. Why the user list, and not the developer list? Because there are more users than developers, so more people who can help you. </p>
  605. <p>
  606. Please only file a bug report against Ant for a configuration/startup problem if
  607. there really is a fixable bug in Ant related to configuration, such as it not
  608. working on a particular platform, with a certain JVM version, etc, or if you are
  609. advised to do it by the user mailing list.
  610. </p>
  611. <hr>
  612. <p align="center">Copyright &copy; 2000-2005 The Apache Software Foundation. All rights
  613. Reserved.</p>
  614. </body>
  615. </html>