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 44 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="stylesheets/style.css">
  19. <title>Installing Ant</title>
  20. </head>
  21. <body>
  22. <h1>Installing Ant</h1>
  23. <h2><a name="getting">Getting Ant</a></h2>
  24. <h3>The Short Story</h3>
  25. <p>To get up and running with the binary edition of Ant quickly, follow these steps:
  26. <ol>
  27. <li>Make sure you have a Java environment installed, See <a href="#sysrequirements">System
  28. Requirements</a> for details.</li>
  29. <li>Download Ant. See <a href="#getBinary">Binary Edition</a> for details.</li>
  30. <li>Uncompress the downloaded file into a directory.</li>
  31. <li>Set environmental variables <code>JAVA_HOME</code> to your Java environment, <code>ANT_HOME</code> to
  32. the directory you uncompressed Ant to, and add <code>${ANT_HOME}/bin</code> (Unix) or
  33. <code>%ANT_HOME%/bin</code> (Windows) to your <code>PATH</code>. See <a href="#setup">Setup</a> for details.</li>
  34. <li>Optionally, from the <code>ANT_HOME</code> directory run <code>ant -f fetch.xml -Ddest=system</code> to get
  35. the library dependencies of most of the Ant tasks that require them. If you don't do this, many of the dependent
  36. Ant tasks will not be available. See <a href="#optionalTasks">Optional Tasks</a> for details and other options
  37. for the -Ddest parameter.</li>
  38. <li>Optionally, add any desired Antlibs. See <a href="http://ant.apache.org/antlibs/proper.html" target="_top">Ant Libraries</a> for a list.
  39. </ol>
  40. </p>
  41. <p>
  42. Note that the links in the list above will give more details about each of the steps,
  43. should you need them. Or you can just continue reading the rest of this document.
  44. </p>
  45. The short story for working with the Ant source code (not needed if you are working with the binary edition) is:
  46. <ol>
  47. <li>Get the source code. See <a href="#sourceEdition">Source Edition</a> for details.</li>
  48. <li> Build Ant. See <a href="#buildingant">Building Ant</a> for details.</li>
  49. </ol>
  50. <p>
  51. </p>
  52. <p>
  53. For the full story, continue reading.
  54. </p>
  55. <h3><a name="getBinary">Binary Edition</a></h3>
  56. <p>The latest stable version of Ant is available from the Ant web page <a
  57. href="http://ant.apache.org/" target="_top">http://ant.apache.org/</a>
  58. </p>
  59. <p>The binary edition of Ant is shipped with 3 different compression formats:
  60. <ol>
  61. <li><b>.zip</b> - Recommended compression format for Windows, can also be used on other platforms. Supported
  62. by many programs and some operating systems natively.</li>
  63. <li><b>.tar.gz</b> - Uses the tar program to gather files together, and gzip to compress and uncompress.</li>
  64. <li><b>.tar.bz2</b> - Uses the tar program to gather files together, and bzip2 to compress and uncompress..</li>
  65. </ol>
  66. Choose the format that is best supported for your platform.
  67. </p>
  68. <h3>As a binary in an RPM Package</h3>
  69. <p>Consult the <a href="#jpackage">jpackage</a> section below.</p>
  70. <h3>Bundled in IDEs</h3>
  71. <p>
  72. All the main Java IDEs ship with Ant, products such as Eclipse, NetBeans
  73. and IntelliJ IDEA. If you install Ant this way you usually get the most recent
  74. release of Ant at the time the IDE was released. Some of the IDEs (Eclipse
  75. and NetBeans in particular) ship with extra tasks that only work if
  76. IDE-specific tools are on Ant's path. To use these on command-line versions
  77. of Ant, the relevant JARs need to be added to the command-line Ant as
  78. extra libraries/tasks. Note that if it is an IDE task or extension that is
  79. not behaving, the Ant team is unable to field bug reports. Try the IDE mailing
  80. lists first, who will cross-file bugs if appropriate.
  81. </p>
  82. <p>
  83. IDE's can invariably be pointed at different Ant installations. This lets
  84. developers upgrade to a new release of Ant, and eliminate inconsistencies
  85. between command-line and IDE Ant.
  86. </p>
  87. <h3>Bundled in Java applications</h3>
  88. <p>
  89. Many Java applications, most particularly application servers, ship with
  90. a version of Ant. These are primarily for internal use by the application,
  91. using the Java APIs to delegate tasks such as JSP page compilation to the Ant
  92. runtime. Such distributions are usually unsupported by everyone. Particularly
  93. troublesome are those products that not only ship with their own Ant release,
  94. they add their own version of ANT.BAT or ant.sh to the PATH. If Ant starts
  95. behaving wierdly after installing something, try the
  96. <a href="#diagnostics">diagnostics</a> advice.
  97. </p>
  98. <h3><a name="sourceEdition">Source Edition</a></h3>
  99. <p>If you prefer the source edition, you can download the source for the latest
  100. Ant release from
  101. <a href="http://ant.apache.org/srcdownload.cgi" target="_top">http://ant.apache.org/srcdownload.cgi</a>.
  102. If you prefer the leading-edge code, you can access
  103. the code as it is being developed via SVN. The Ant website has details on
  104. <a href="http://ant.apache.org/svn.html" target="_top">accessing SVN</a>.
  105. All bug fixes will go in against the HEAD of the source tree, and the first
  106. response to many bugreps will be "have you tried the latest version".
  107. Don't be afraid to download and build a prererelease edition, as everything
  108. other than new features are usually stable.
  109. </p>
  110. <p>
  111. See the section <a href="#buildingant">Building Ant</a> on how to
  112. build Ant from the source code.
  113. You can also access the
  114. <a href="http://svn.apache.org/viewcvs.cgi/ant/" target="_top">
  115. Ant SVN repository</a> on-line. </p>
  116. <h3 name="archives">Archive Download Area Layout</h3>
  117. <p>
  118. Older versions of Ant are available in the archives at <a
  119. href="http://archive.apache.org/dist/ant/" target="_top">http://archive.apache.org/dist/ant/</a>. The
  120. files are organized as follows.
  121. </p>
  122. <table>
  123. <tr>
  124. <th>Filename or Path</th>
  125. <th>Description</th>
  126. </tr>
  127. <tr>
  128. <td>KEYS</td>
  129. <td>PGP-Keysfile. It contains the PGP-keys of Ant developers so you can 'trust' the distribution. </td>
  130. </tr>
  131. <tr>
  132. <td>RELEASE-NOTES-{version}.html</td>
  133. <td>
  134. Release notes of the given version in HTML format. When upgrading your Ant installation you
  135. should have a look at the <i>Changes that could break older environments</i> section.
  136. </td>
  137. </tr>
  138. <tr>
  139. <td>ant-current-bin.zip</td>
  140. <td>
  141. ZIP-Archive containing the compiled version of Ant in the last released version. It is recommended that
  142. you do not download the latest version this way, as the standard way of downloading described above will
  143. redirect you to a mirror closer to you, thus making the download faster for you and reducing the load
  144. on Apache servers.
  145. </td>
  146. </tr>
  147. <tr>
  148. <td>ant-current-src.zip</td>
  149. <td>
  150. ZIP-Archive containing the sources of Ant. If you have this you could compile Ant itself.
  151. If you do not have the <i>required</i> dependencies, the classes depeding on them are just not
  152. built. Again, it is preferred to use the standard way of getting the source package described above
  153. to make your download quicker and to reduce the load on Apache servers.
  154. </td>
  155. </tr>
  156. <tr>
  157. <td>ant-current-*.asc</td>
  158. <td>
  159. Security file for checking the correctness of the zip file. This one is the
  160. <a href="http://en.wikipedia.org/wiki/Pretty_Good_Privacy" target="_blank">PGP</a> key.
  161. </td>
  162. </tr>
  163. <tr>
  164. <td>ant-current-*.md5</td>
  165. <td>
  166. Security file for checking the correctness of the zip file. This one is the
  167. <a href="http://en.wikipedia.org/wiki/Md5" target="_blank">MD5</a> key.
  168. </td>
  169. </tr>
  170. <tr>
  171. <td>ant-current-*.sha1</td>
  172. <td>
  173. Security file for checking the correctness of the zip file. This one is the
  174. <a href="http://en.wikipedia.org/wiki/SHA-1" target="_blank">SHA1</a> key.
  175. </td>
  176. </tr>
  177. <tr>
  178. <td>antlibs/</td>
  179. <td>
  180. This directory holds the Antlibs that are made of available by the Apache Ant project.
  181. Antlibs are bundles of Ant tasks that are not delivered as part of the Ant core but are
  182. available as optional downloads.
  183. </td>
  184. </tr>
  185. <tr>
  186. <td>binaries/</td>
  187. <td>
  188. The binaries directory holds specific Ant releases bundled in both ZIP and tar.gz compression
  189. formats. The named releases are in contrast to the ant-current-bin.zip file in the parent
  190. directory, which is always guaranteed to be the most current release of Ant.
  191. </td>
  192. </tr>
  193. <tr>
  194. <td>common/</td>
  195. <td>
  196. The common directory holds various files, such as the Apache License file that Ant is licensed
  197. under, that people may wish to examine without having to download the whole Ant distribution.
  198. </td>
  199. </tr>
  200. <tr>
  201. <td>source/</td>
  202. <td>
  203. The source directory holds the source code for specific Ant releases bundled in both ZIP and
  204. tar.gz compression formats. The named releases are in contrast to the ant-current-src.zip file
  205. in the parent directory, which is always guaranteed to hold the source code for the most current
  206. release of Ant.
  207. </td>
  208. </tr>
  209. </table>
  210. <hr>
  211. <h2><a name="sysrequirements">System Requirements</a></h2>
  212. Ant has been used successfully on many platforms, including Linux,
  213. commercial flavours of Unix such as Solaris and HP-UX,
  214. Windows NT-platforms, OS/2 Warp, Novell Netware 6, OpenVMS and MacOS X.
  215. The platforms used most for development are, in no particular order,
  216. Linux, MacOS X, Windows XP and Unix; these are therefore that platforms
  217. that tend to work best. As of Ant1.7, Windows 9x is no longer supported.
  218. <p>
  219. For the current version of Ant, you will also need a JDK installed on
  220. your system, version 1.4 or later required, 1.5 or later strongly recommended.
  221. The later the version of Java , the more Ant tasks you get.
  222. </p>
  223. <p>
  224. <strong>Note: </strong>If a JDK is not present, only the JRE runtime, then many tasks will not work.
  225. </p>
  226. <p>
  227. <strong>Note: </strong>
  228. Ant 1.8.* works with jdk1.4 and higher, Ant 1.7.* works with jdk1.3 and higher, Ant 1.6.* works with jdk 1.2 and higher,
  229. Ant 1.2 to Ant 1.5.* work with jdk 1.1 and higher.
  230. </p>
  231. <h3>Open Source Java Runtimes</h3>
  232. <p>
  233. The Ant team strongly supports users running Ant on Kaffe and other
  234. open source Java runtimes, and so strives to have a product that works
  235. well on those platforms. What appears to work well is Kaffe with
  236. Gnu Classpath and the Xerces and Xalan libraries.
  237. </p>
  238. <hr>
  239. <h2><a name="installing">Installing Ant</a></h2>
  240. <p>The binary distribution of Ant consists of the following directory layout:
  241. <pre>
  242. ant
  243. +--- README, LICENSE, fetch.xml, other text files. //basic information
  244. +--- bin // contains launcher scripts
  245. |
  246. +--- lib // contains Ant jars plus necessary dependencies
  247. |
  248. +--- docs // contains documentation
  249. | |
  250. | +--- images // various logos for html documentation
  251. | |
  252. | +--- manual // Ant documentation (a must read ;-)
  253. |
  254. +--- etc // contains xsl goodies to:
  255. // - create an enhanced report from xml output of various tasks.
  256. // - migrate your build files and get rid of 'deprecated' warning
  257. // - ... and more ;-)
  258. </pre>
  259. Only the <code>bin</code> and <code>lib</code> directories are
  260. required to run Ant.
  261. To install Ant, choose a directory and copy the distribution
  262. files there. This directory will be known as ANT_HOME.
  263. </p>
  264. <table width="80%">
  265. <tr>
  266. <td colspan="2">
  267. <b>Windows 95, Windows 98 &amp; Windows ME Note:</b>
  268. </td>
  269. </tr>
  270. <tr>
  271. <td width="5%">&nbsp;</td>
  272. <td><i>
  273. Note that current releases of Ant no longer support these systems. If you are using an older
  274. version of Ant, however, the script used to launch Ant will have
  275. problems if ANT_HOME is a long filename (i.e. a filename which is not
  276. of the format known as &quot;8.3&quot;). This is due to
  277. limitations in the OS's handling of the <code>&quot;for&quot;</code>
  278. batch-file statement. It is recommended, therefore, that Ant be
  279. installed in a <b>short</b>, 8.3 path, such as C:\Ant. </i>
  280. </td>
  281. </tr>
  282. <tr>
  283. <td width="5%">&nbsp;</td>
  284. <td>
  285. <p>On these systems you will also need to configure more environment
  286. space to cater for the environment variables used in the Ant lauch script.
  287. To do this, you will need to add or update the following line in
  288. the <code>config.sys</code> file
  289. </p>
  290. <p><code>shell=c:\command.com c:\ /p /e:32768</code></p>
  291. </td>
  292. </tr>
  293. </table>
  294. <h3><a name="setup">Setup</a></h3>
  295. <p>
  296. Before you can run Ant there is some additional set up you
  297. will need to do unless you are installing the <a href="#jpackage">RPM
  298. version from jpackage.org</a>:</p>
  299. <ul>
  300. <li>Add the <code>bin</code> directory to your path.</li>
  301. <li>Set the <code>ANT_HOME</code> environment variable to the
  302. directory where you installed Ant. On some operating systems, Ant's
  303. startup scripts can guess <code>ANT_HOME</code> (Unix dialects and
  304. Windows NT/2000), but it is better to not rely on this behavior.</li>
  305. <li>Optionally, set the <code>JAVA_HOME</code> environment variable
  306. (see the <a href="#advanced">Advanced</a> section below).
  307. This should be set to the directory where your JDK is installed.</li>
  308. </ul>
  309. <p>Operating System-specific instructions for doing this from the command
  310. line are in the <a href="#windows">Windows</a>, <a href="#bash">Linux/Unix (bash)</a>,
  311. and <a href="#tcshcsh">Linux/Unix (csh)</a> sections. Note that using this method,
  312. the settings will only be valid for the command line session you run them in.</p>
  313. <p><strong>Note:</strong> Do not install Ant's ant.jar file into the lib/ext
  314. directory of the JDK/JRE. Ant is an application, whilst the extension
  315. directory is intended for JDK extensions. In particular there are security
  316. restrictions on the classes which may be loaded by an extension.</p>
  317. <table width="80%">
  318. <tr>
  319. <td colspan="2">
  320. <b>Windows Note:</b>
  321. </td>
  322. </tr>
  323. <tr>
  324. <td width="5%">&nbsp;</td>
  325. <td>
  326. The ant.bat script makes use of three environment variables -
  327. ANT_HOME, CLASSPATH and JAVA_HOME. <b>Ensure</b> that ANT_HOME and JAVA_HOME variables are set,
  328. and that they do <b><u>not</u></b> have quotes (either
  329. ' or &quot;) and they do <b><u>not</u></b> end with \ or with /. CLASSPATH should be unset or
  330. empty.
  331. </td>
  332. </tr>
  333. </table>
  334. <h3><a name="checkInstallation">Check Installation</a></h3>
  335. <p>You can check the basic installation with opening a new shell and typing <tt>ant</tt>. You
  336. should get a message like this
  337. <pre>
  338. Buildfile: build.xml does not exist!
  339. Build failed
  340. </pre>
  341. So Ant works. This message is there because you need to write an individual buildfile for your
  342. project. With a <tt>ant -version</tt> you should get an output like
  343. <pre>
  344. Apache Ant version 1.7.1 compiled on June 27 2008
  345. </pre>
  346. </p>
  347. <p>If this does not work ensure your environment variables are set right. They must resolve to:
  348. <ul>
  349. <li>required: %ANT_HOME%\bin\ant.bat</li>
  350. <li>optional: %JAVA_HOME%\bin\java.exe</li>
  351. <li>required: %PATH%=...<i>maybe-other-entries</i>...;%ANT_HOME%\bin;...<i>maybe-other-entries</i>...</li>
  352. </ul>
  353. <b>ANT_HOME</b> is used by the launcher script for finding the libraries.
  354. <b>JAVA_HOME</b> is used by the launcher for finding the JDK/JRE to use. (JDK is recommended as some tasks
  355. require the java tools.) If not set, the launcher tries to find one via the %PATH% environment variable.
  356. <b>PATH</b> is set for user convinience. With that set you can just start <i>ant</i> instead of always typing
  357. <i>the/complete/path/to/your/ant/installation/bin/ant</i>.
  358. </p>
  359. <h3><a name="optionalTasks">Optional Tasks</a></h3>
  360. <p>Ant supports a number of optional tasks. An optional task is a task which
  361. typically requires an external library to function. The optional tasks are
  362. packaged together with the core Ant tasks.</p>
  363. <p>The external libraries required by each of the optional tasks is detailed
  364. in the <a href="#librarydependencies">Library Dependencies</a> section. These external
  365. libraries must be added to Ant's classpath, in any of the following ways:
  366. </p>
  367. <ul>
  368. <li><p>
  369. In <code><i>ANT_HOME</i>/lib</code>. This makes the JAR files available to all
  370. Ant users and builds.
  371. </p></li>
  372. <li><p>
  373. In <code>${user.home}/.ant/lib</code> (as of Ant 1.6). This
  374. allows different users to add new libraries to Ant. All JAR files
  375. added to this directory are available to command-line Ant.
  376. </p></li>
  377. <li><p>
  378. On the command line with a <code>-lib</code> parameter. This lets
  379. you add new JAR files on a case-by-case basis.
  380. </p></li>
  381. <li><p>
  382. In the <code>CLASSPATH</code> environment variable. Avoid this; it makes
  383. the JAR files visible to <i>all</i> Java applications, and causes
  384. no end of support calls. See <a href="#classpath">below</a> for details.
  385. </p>
  386. </li>
  387. <li><p>
  388. In some <code>&lt;classpath&gt;</code> accepted by the task itself.
  389. For example, as of Ant 1.7.0 you can run the <code>&lt;junit&gt;</code>
  390. task without <code>junit.jar</code> in Ant's own classpath, so long as
  391. it is included (along with your program and tests) in the classpath
  392. passed when running the task.
  393. </p><p>
  394. Where possible, this option is generally
  395. to be preferred, as the Ant script itself can determine the best path
  396. to load the library from: via relative path from the basedir (if you
  397. keep the library under version control with your project), according
  398. to Ant properties, environment variables, Ivy downloads, whatever you like.
  399. </p></li>
  400. </ul>
  401. <p>
  402. If you are using the binary version of Ant, or if you are working from source
  403. code, you can easily gather most of the dependencies and install them for use
  404. with your Ant tasks. In your <code>ANT_HOME</code> directory you should see a
  405. file called <code>fetch.xml</code>. This is an Ant script that you can run to
  406. install almost all the dependencies the optional Ant tasks need.
  407. </p>
  408. <p>
  409. To do so, change to the <code>ANT_HOME</code> directory and execute the command:
  410. </p>
  411. <blockquote>
  412. <pre>ant -f fetch.xml -Ddest=<i>[option]</i></pre>
  413. </blockquote
  414. <p>
  415. where option is one of the following, as described above:
  416. <ul>
  417. <li><code>system</code> - store in Ant's lib directory <i>(Recommended)</i></li>
  418. <li><code>user</code> - store in the user's home directory</li>
  419. <li><code>optional</code> - store in Ant's source code lib/optional directory, used if building Ant source code</li>
  420. </ul>
  421. </p>
  422. <p>
  423. You may also need to set proxy settings. See the <a href="#proxy">Proxy Settings</a> section for details.
  424. </p>
  425. <p>
  426. Note that not all dependencies are gathered using <code>fetch.xml</code>. Tasks that depend on
  427. commercial software, in particular, will require you to have the commercial software installed
  428. in order to be used.
  429. </p>
  430. <p>The Apache Ant Project also provides additional tasks and types that are available as separately
  431. downloaded Ant Libraries. You can see the the list of available Antlibs at
  432. the <a href="http://ant.apache.org/antlibs/proper.html" target="_top">Ant Libraries</a> page.
  433. </p>
  434. <p>You can also find tasks and types provided by third-party projects at the
  435. <a href="http://ant.apache.org/external.html" target="_top">External Tools and Tasks</a> page.
  436. </p>
  437. <p>
  438. IDEs have different ways of adding external JAR files and third-party tasks
  439. to Ant. Usually it is done by some configuration dialog. Sometimes JAR files
  440. added to a project are automatically added to ant's classpath.
  441. </p>
  442. <h3><a name="classpath">The <code>CLASSPATH</code> environment variable</a></h3>
  443. <p>
  444. The <code>CLASSPATH</code> environment variable is a source of many Ant support queries. As
  445. the round trip time for diagnosis on the Ant user mailing list can be slow, and
  446. because filing bug reports complaining about 'ant.bat' not working will be
  447. rejected by the developers as WORKSFORME "this is a configuration problem, not a
  448. bug", you can save yourself a lot of time and frustration by following some
  449. simple steps.
  450. </p>
  451. <ol>
  452. <li>Do not ever set <code>CLASSPATH</code>. Ant does not need it, it only causes confusion
  453. and breaks things.
  454. </li>
  455. <li>If you ignore the previous rule, do not ever, ever, put quotes in the
  456. <code>CLASSPATH</code>, even if there is a space in a directory. This will break Ant, and it
  457. is not needed. </li>
  458. <li>If you ignore the first rule, do not ever, ever, have a trailing backslash
  459. in a <code>CLASSPATH</code>, as it breaks Ant's ability to quote the string. Again, this is
  460. not needed for the correct operation of the <code>CLASSPATH</code> environment variable, even
  461. if a DOS directory is to be added to the path. </li>
  462. <li>You can stop Ant using the <code>CLASSPATH</code> environment variable by setting the
  463. <code>-noclasspath</code> option on the command line. This is an easy way
  464. to test for classpath-related problems.</li>
  465. </ol>
  466. <p>
  467. The usual symptom of <code>CLASSPATH</code> problems is that ant will not run with some error
  468. about not being able to find <code>org.apache.tools.ant.launch.Launcher</code>, or, if you have got the
  469. quotes/backslashes wrong, some very weird Java startup error. To see if this is
  470. the case, run <code>ant -noclasspath</code> or unset the <code>CLASSPATH</code> environment
  471. variable.
  472. </p>
  473. <p>
  474. You can also make your Ant script reject this environment
  475. variable just by placing the following at the top of the script (or in an init target):
  476. </p>
  477. <pre>
  478. &lt;property environment="env."/&gt;
  479. &lt;property name="env.CLASSPATH" value=""/&gt;
  480. &lt;fail message="Unset $CLASSPATH / %CLASSPATH% before running Ant!"&gt;
  481. &lt;condition&gt;
  482. &lt;not&gt;
  483. &lt;equals arg1="${env.CLASSPATH}" arg2=""/&gt;
  484. &lt;/not&gt;
  485. &lt;/condition&gt;
  486. &lt;/fail&gt;
  487. </pre>
  488. <h3><a name="proxy">Proxy Configuration</a></h3>
  489. <p> Many Ant built-in and third-party tasks use network connections to retrieve
  490. files from HTTP servers. If you are behind a firewall with a proxy server, then
  491. Ant needs to be configured with the proxy. Here are the different ways to do
  492. this. </p>
  493. <ul>
  494. <li><b>With Java1.5</b><br>
  495. <p>
  496. When you run Ant on Java1.5, you could try to use the automatic proxy setup
  497. mechanism with <code>-autoproxy</code>.
  498. </p>
  499. </li>
  500. <li><b>With explicit JVM properties.</b><br>
  501. <p>
  502. These are documented <a
  503. href="http://download.oracle.com/javase/1.5.0/docs/guide/net/properties.html" target="_top">by Oracle</a>,
  504. and control the proxy behaviour of the entire JVM. To set them in Ant, declare
  505. them in the <code>ANT_OPTS</code> environment variable. This is the best option
  506. for a non-mobile system. For a laptop, you have to change these settings as you
  507. roam. To set ANT_OPTS:
  508. </p>
  509. <blockquote>
  510. <p>
  511. For csh/tcsh:
  512. </p>
  513. <pre>
  514. setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  515. </pre>
  516. <p>
  517. For bash:
  518. </p>
  519. <pre>
  520. export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
  521. </pre>
  522. <p>
  523. For Windows, set the environment variable in the appropriate dialog box
  524. and open a new console. or, by hand
  525. </p>
  526. <pre>
  527. set ANT_OPTS = -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
  528. </pre>
  529. </p>
  530. </blockquote>
  531. </li>
  532. <li><b>In the build file itself</b><br>
  533. <p>
  534. If you are writing a build file that is always to be used behind the firewall,
  535. the &lt;setproxy&gt; task lets you configure the proxy (which it does by setting
  536. the JVM properties). If you do this, we strongly recommend using ant properties
  537. to define the proxy host, port, etc, so that individuals can override the
  538. defaults.</li>
  539. </p>
  540. </ul>
  541. <p> The Ant team acknowledges that this is unsatisfactory. Until the JVM
  542. automatic proxy setup works properly everywhere, explicit JVM options via
  543. ANT_ARGS are probably the best solution. Setting properties on Ant's
  544. command line do not work, because those are <i>Ant properties</i> being set, not
  545. JVM options. This means the following does not set up the command line:
  546. </p>
  547. <pre>ant -Dhttp.proxyHost=proxy -Dhttp.proxyPort=81</pre>
  548. <p> All it does is set up two Ant properties.</p>
  549. <p>One other troublespot with
  550. proxies is with authenticating proxies. Ant cannot go beyond what the JVM does
  551. here, and as it is very hard to remotely diagnose, test and fix proxy-related
  552. problems, users who work behind a secure proxy will have to spend much time
  553. configuring the JVM properties until they are happy. </p>
  554. <h3><a name="windows">Windows and OS/2</a></h3>
  555. <p>Assume Ant is installed in <code>c:\ant\</code>. The following sets up the
  556. environment:</p>
  557. <pre>set ANT_HOME=c:\ant
  558. set JAVA_HOME=c:\jdk-1.5.0.05
  559. set PATH=%PATH%;%ANT_HOME%\bin</pre>
  560. <h3><a name="bash">Linux/Unix (bash)</a></h3>
  561. <p>Assume Ant is installed in <code>/usr/local/ant</code>. The following sets up
  562. the environment:</p>
  563. <pre>export ANT_HOME=/usr/local/ant
  564. export JAVA_HOME=/usr/local/jdk-1.5.0.05
  565. export PATH=${PATH}:${ANT_HOME}/bin</pre>
  566. <h3><a name="tcshcsh">Linux/Unix (csh)</a></h3>
  567. <pre>setenv ANT_HOME /usr/local/ant
  568. setenv JAVA_HOME /usr/local/jdk/jdk-1.5.0.05
  569. set path=( $path $ANT_HOME/bin )</pre>
  570. <p>
  571. Having a symbolic link set up to point to the JVM/JDK version makes updates more seamless. </p>
  572. <a name="jpackage"></a>
  573. <h3>RPM version from jpackage.org</h3>
  574. <p>
  575. The <a href="http://www.jpackage.org" target="_top">JPackage project</a> distributes an RPM version of Ant.
  576. With this version, it is not necessary to set <code> JAVA_HOME </code>or
  577. <code> ANT_HOME </code>environment variables and the RPM installer will correctly
  578. place the Ant executable on your path.
  579. </p>
  580. <p>
  581. <b>NOTE:</b> <em>Since Ant 1.7.0</em>, if the <code>ANT_HOME</code>
  582. environment variable is set, the jpackage distribution will be
  583. ignored.
  584. </p>
  585. <p>
  586. Optional jars for the JPackage version are handled in two ways. The easiest, and
  587. best way is to get these external libraries from JPackage if JPackage has them
  588. available. (Note: for each such library, you will have to get both the external
  589. package itself (e.g. <code>oro-2.0.8-2jpp.noarch.rpm</code>) and the small library that links
  590. ant and the external package (e.g. <code>ant-apache-oro-1.6.2-3jpp.noarch.rpm</code>).
  591. </p><p>
  592. However, JPackage does not package proprietary software, and since some of the
  593. optional packages depend on proprietary jars, they must be handled as follows.
  594. This may violate the spirit of JPackage, but it is necessary if you need these proprietary packages.
  595. For example, suppose you want to install support for netrexx, which jpackage does not
  596. support:
  597. <ol>
  598. <li>Decide where you want to deploy the extra jars. One option is in <code>$ANT_HOME/lib</code>,
  599. which, for JPackage is usually <code>/usr/share/ant/lib</code>. Another, less messy option
  600. is to create an <code>.ant/lib</code> subdirectory of your home directory and place your
  601. non-jpackage ant jars there, thereby avoiding mixing jpackage
  602. libraries with non-jpackage stuff in the same folder.
  603. More information on where Ant finds its libraries is available
  604. <a href="http://ant.apache.org/manual/running.html#libs">here</a></li>
  605. <li>Download a non-jpackage binary distribution from the regular
  606. <a href="http://ant.apache.org/bindownload.cgi" target="_top">Apache Ant site</a></li>
  607. <li>Unzip or untar the distribution into a temporary directory</li>
  608. <li>Copy the linking jar, in this case <code>ant-jai.jar</code>, into the library directory you
  609. chose in step 1 above.</li>
  610. <li>Copy the proprietary jar itself into the same directory.</li>
  611. </ol>
  612. Finally, if for some reason you are running on a system with both the JPackage and Apache versions of Ant
  613. available, if you should want to run the Apache version (which will have to be specified with an absolute file name,
  614. not found on the path), you should use Ant's <code>--noconfig</code> command-line switch to avoid JPackage's classpath mechanism.
  615. <h3><a name="advanced">Advanced</a></h3>
  616. <p>There are lots of variants that can be used to run Ant. What you need is at
  617. least the following:</p>
  618. <ul>
  619. <li>The classpath for Ant must contain <code>ant.jar</code> and any jars/classes
  620. needed for your chosen JAXP-compliant XML parser.</li>
  621. <li>When you need JDK functionality
  622. (such as for the <a href="Tasks/javac.html">javac</a> task or the
  623. <a href="Tasks/rmic.html">rmic</a> task), then <code>tools.jar</code>
  624. must be added. The scripts supplied with Ant,
  625. in the <code>bin</code> directory, will add
  626. the required JDK classes automatically, if the <code>JAVA_HOME</code>
  627. environment variable is set.</li>
  628. <li>When you are executing platform-specific applications, such as the
  629. <a href="Tasks/exec.html">exec</a> task or the
  630. <a href="Tasks/cvs.html">cvs</a> task, the property <code>ant.home</code>
  631. must be set to the directory containing where you installed Ant. Again
  632. this is set by the Ant scripts to the value of the ANT_HOME environment
  633. variable.</li>
  634. </ul>
  635. The supplied ant shell scripts all support an <tt>ANT_OPTS</tt>
  636. environment variable which can be used to supply extra options
  637. to ant. Some of the scripts also read in an extra script stored
  638. in the users home directory, which can be used to set such options. Look
  639. at the source for your platform's invocation script for details.
  640. <hr>
  641. <h2><a name="buildingant">Building Ant</a></h2>
  642. <p>To build Ant from source, you can either install the Ant source distribution
  643. or checkout the ant module from SVN. See <a href="#sourceEdition">Source Edition</a> for details.</p>
  644. <p>Once you have installed the source, change into the installation
  645. directory.</p>
  646. <p>Set the <code>JAVA_HOME</code> environment variable
  647. to the directory where the JDK is installed.
  648. See <a href="#installing">Installing Ant</a>
  649. for examples on how to do this for your operating system. </p>
  650. <p><b>Note</b>: The bootstrap process of Ant requires a greedy
  651. compiler like Sun's javac or jikes. It does not work with gcj or
  652. kjc.</p>
  653. <p>Make sure you have downloaded any auxiliary jars required to
  654. build tasks you are interested in. These should be
  655. added to the <code>lib/optional</code>
  656. directory of the source tree.
  657. See <a href="#librarydependencies">Library Dependencies</a>
  658. for a list of JAR requirements for various features.
  659. Note that this will make the auxiliary JAR
  660. available for the building of Ant only. For running Ant you will
  661. still need to
  662. make the JARs available as described under
  663. <a href="#installing">Installing Ant</a>.</p>
  664. <p>You can also get most of the auxiliary jar files (ie. the jar files
  665. that various optional Ant tasks depend on) by running Ant on the
  666. <code>fetch.xml</code> build file. See <a href="#optionalTasks">Optional
  667. Tasks</a> for instructions on how to do this.
  668. </p>
  669. <p>As of version 1.7.0 Ant has a hard dependency on JUnit. The <code>fetch.xml</code> build
  670. script will download JUnit automatically, but if you don't use this you must
  671. install it manually into <code>lib/optional</code> (download it from
  672. <a href="http://junit.org/" target="_top">JUnit.org</a>) if you are
  673. using a source distribution of Ant.</p>
  674. <p>Your are now ready to build Ant:</p>
  675. <blockquote>
  676. <p><code>build -Ddist.dir=&lt;<i>directory_to_contain_Ant_distribution</i>&gt; dist</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  677. <p><code>sh build.sh -Ddist.dir=&lt;<i>directory_to_contain_Ant_distribution</i>&gt; dist</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  678. </blockquote>
  679. <p>This will create a binary distribution of Ant in the directory you specified.</p>
  680. <p>The above action does the following:</p>
  681. <ul>
  682. <li>If necessary it will bootstrap the Ant code. Bootstrapping involves the manual
  683. compilation of enough Ant code to be able to run Ant. The bootstrapped Ant is
  684. used for the remainder of the build steps. </li>
  685. <li>Invokes the bootstrapped Ant with the parameters passed to the build script. In
  686. this case, these parameters define an Ant property value and specify the &quot;dist&quot; target
  687. in Ant's own <code>build.xml</code> file.</li>
  688. <li>Create the ant.jar and ant-launcher.jar JAR files</li>
  689. <li>Create optional JARs for which the build had the relevant libraries. If
  690. a particular library is missing from ANT_HOME/lib/optional, then the matching
  691. ant- JAR file will not be created. For example, ant-junit.jar is only built
  692. if there is a junit.jar in the optional directory.</li>
  693. </ul>
  694. <p>On most occasions you will not need to explicitly bootstrap Ant since the build
  695. scripts do that for you. If however, the build file you are using makes use of features
  696. not yet compiled into the bootstrapped Ant, you will need to manually bootstrap.
  697. Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX)
  698. to build a new bootstrap version of Ant.</p>
  699. If you wish to install the build into the current <code>ANT_HOME</code>
  700. directory, you can use:
  701. <blockquote>
  702. <p><code>build install</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  703. <p><code>sh build.sh install</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  704. </blockquote>
  705. You can avoid the lengthy Javadoc step, if desired, with:
  706. <blockquote>
  707. <p><code>build install-lite</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  708. <p><code>sh build.sh install-lite</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  709. </blockquote>
  710. This will only install the <code>bin</code> and <code>lib</code> directories.
  711. <p>Both the <code>install</code> and
  712. <code>install-lite</code> targets will overwrite
  713. the current Ant version in <code>ANT_HOME</code>.</p>
  714. <p>Ant's build script will try to set executable flags for its shell
  715. scripts on Unix-like systems. There are various reasons why the
  716. chmod-task might fail (like when you are running the build script as
  717. a different user than the one who installed Ant initially). In this
  718. case you can set the Ant property <code>chmod.fail</code> to false
  719. when starting the build like in
  720. <blockquote>
  721. <p><code>sh build.sh install -Dchmod.fail=false</code></p>
  722. </blockquote>
  723. and any error to change permission will not result in a build failure.</p>
  724. <hr>
  725. <h2><a name="librarydependencies">Library Dependencies</a></h2>
  726. <p>The following libraries are needed in Ant's classpath
  727. if you are using the
  728. indicated feature. Note that only one of the regexp libraries is
  729. needed for use with the mappers
  730. (and Java includes a regexp implementation which
  731. Ant will find automatically).
  732. You will also need to install the particular
  733. Ant optional jar containing the task definitions to make these
  734. tasks available. Please refer to the <a href="#optionalTasks">
  735. Installing Ant / Optional Tasks</a> section above.</p>
  736. <table border="1" cellpadding="2" cellspacing="0">
  737. <tr>
  738. <td><b>Jar Name</b></td>
  739. <td><b>Needed For</b></td>
  740. <td><b>Available At</b></td>
  741. </tr>
  742. <tr>
  743. <td>jakarta-regexp-1.3.jar</td>
  744. <td>regexp type with mappers (if you do not wish to use java.util.regex)</td>
  745. <td><a href="http://jakarta.apache.org/regexp/" target="_top">http://jakarta.apache.org/regexp/</a></td>
  746. </tr>
  747. <tr>
  748. <td>jakarta-oro-2.0.8.jar</td>
  749. <td>regexp type with mappers (if you do not wish to use java.util.regex) and the Perforce tasks<br>
  750. To use the FTP task,
  751. you need jakarta-oro 2.0.8 or later, and <a href="#commons-net">commons-net</a></td>
  752. <td><a href="http://jakarta.apache.org/oro/" target="_top">http://jakarta.apache.org/oro/</a></td>
  753. </tr>
  754. <tr>
  755. <td>junit.jar</td>
  756. <td><code>&lt;junit&gt;</code> task. May be in classpath passed to task rather than Ant's classpath.</td>
  757. <td><a href="http://www.junit.org/" target="_top">http://www.junit.org/</a></td>
  758. </tr>
  759. <tr>
  760. <td>xalan.jar</td>
  761. <td>junitreport task</td>
  762. <td><a href="http://xml.apache.org/xalan-j/" target="_top">http://xml.apache.org/xalan-j/</a></td>
  763. </tr>
  764. <tr>
  765. <td>antlr.jar</td>
  766. <td>antlr task</td>
  767. <td><a href="http://www.antlr.org/" target="_top">http://www.antlr.org/</a></td>
  768. </tr>
  769. <tr>
  770. <td>bsf.jar</td>
  771. <td>script task
  772. <p>
  773. <strong>Note</strong>: Ant 1.6 and later require Apache BSF, not
  774. the IBM version. I.e. you need BSF 2.3.0-rc1 or later.
  775. </p>
  776. <p>
  777. <strong>Note</strong>: BSF 2.4.0 is needed to use a post 1.5R3 version
  778. of rhino's javascript.
  779. </p>
  780. <p>
  781. <strong>Note</strong>: BSF 2.4.0 uses jakarata-commons-logging
  782. so it needs the commons-logging.jar.
  783. </p>
  784. </td>
  785. <td><a href="http://jakarta.apache.org/bsf/" target="_top">http://jakarta.apache.org/bsf/</a></td>
  786. </tr>
  787. <tr>
  788. <td>Groovy jars</td>
  789. <td>Groovy with script and scriptdef tasks<br>
  790. You need to get the groovy jar and two asm jars from a groovy
  791. installation. The jars are groovy-[version].jar, asm-[vesion].jar and
  792. asm-util-[version].jar and antlr-[version].jar.
  793. As of groovy version 1.0-JSR-06, the jars are
  794. groovy-1.0-JSR-06.jar, antlr-2.7.5.jar, asm-2.2.jar and asm-util-2.2.jar.
  795. Alternatively one may use the embedded groovy jar file.
  796. This is located in the embedded directory of the groovy distribution.
  797. This bundles all the needed jar files into one jar file.
  798. It is called groovy-all-[version].jar.
  799. </td>
  800. <td>
  801. <a href="http://groovy.codehaus.org/" target="_top">http://groovy.codehaus.org/</a>
  802. <br>
  803. The asm jars are also available from the creators of asm -
  804. <a href="http://asm.objectweb.org/" target="_top">http://asm.objectweb.org/</a>
  805. </td>
  806. </tr>
  807. <tr>
  808. <td>netrexx.jar</td>
  809. <td>netrexx task, Rexx with the script task</td>
  810. <td><a href="http://www.ibm.com/software/awdtools/netrexx/download.html" target="_top">
  811. http://www.ibm.com/software/awdtools/netrexx/download.html</a></td>
  812. </tr>
  813. <tr>
  814. <td>js.jar</td>
  815. <td>Javascript with script task<br>
  816. If you use Apache BSF 2.3.0-rc1, you must use rhino 1.5R3 (later
  817. versions of BSF (e.g. version 2.4.0) work with 1.5R4 and higher).</td>
  818. <td><a href="http://www.mozilla.org/rhino/" target="_top">http://www.mozilla.org/rhino/</a></td>
  819. </tr>
  820. <tr>
  821. <td>jython.jar</td>
  822. <td>Python with script task<br>
  823. Warning : jython.jar also contains classes from jakarta-oro.
  824. Remove these classes if you are also using jakarta-oro.</td>
  825. <td><a href="http://jython.sourceforge.net/" target="_top">http://jython.sourceforge.net/</a></td>
  826. </tr>
  827. <tr>
  828. <td>jpython.jar</td>
  829. <td>Python with script task <b>deprecated, jython is the prefered engine</b></td>
  830. <td><a href="http://www.jpython.org/" target="_top">http://www.jpython.org/</a></td>
  831. </tr>
  832. <tr>
  833. <td>jacl.jar and tcljava.jar</td>
  834. <td>TCL with script task</td>
  835. <td><a href="http://www.scriptics.com/software/java/" target="_top">http://www.scriptics.com/software/java/</a></td>
  836. </tr>
  837. <tr>
  838. <td>BeanShell JAR(s)</td>
  839. <td>BeanShell with script task.
  840. <br>
  841. <strong>Note</strong>: Ant requires BeanShell version 1.3 or
  842. later</td>
  843. <td><a href="http://www.beanshell.org/" target="_top">http://www.beanshell.org/</a></td>
  844. </tr>
  845. <tr>
  846. <td>jruby.jar</td>
  847. <td>Ruby with script task</td>
  848. <td><a href="http://jruby.sourceforge.net/" target="_top">http://jruby.sourceforge.net/</a></td>
  849. </tr>
  850. <tr>
  851. <td>judo.jar</td>
  852. <td>Judoscript with script task</td>
  853. <td><a href="http://www.judoscript.org/" target="_top">http://www.judoscript.org/</a></td>
  854. </tr>
  855. <tr>
  856. <td>commons-logging.jar</td>
  857. <td>CommonsLoggingListener</td>
  858. <td><a href="http://jakarta.apache.org/commons/logging/index.html"
  859. target="_top">http://jakarta.apache.org/commons/logging/index.html</a></td>
  860. </tr>
  861. <tr>
  862. <td>log4j.jar</td>
  863. <td>Log4jListener</td>
  864. <td><a href="http://jakarta.apache.org/log4j/docs/index.html"
  865. target="_top">http://jakarta.apache.org/log4j/docs/index.html</a></td>
  866. </tr>
  867. <tr>
  868. <td><a name="commons-net">commons-net.jar</a></td>
  869. <td>ftp, rexec and telnet tasks<br>
  870. jakarta-oro 2.0.8 or later is required together with commons-net 1.4.0.<br>
  871. For all users, a minimum version of commons-net of 1.4.0 is recommended. Earlier
  872. versions did not support the full range of configuration options, and 1.4.0 is needed
  873. to compile Ant.
  874. </td>
  875. <td><a href="http://jakarta.apache.org/commons/net/index.html"
  876. target="_top">http://jakarta.apache.org/commons/net/index.html</a></td>
  877. </tr>
  878. <tr>
  879. <td>bcel.jar</td>
  880. <td>classfileset data type,
  881. JavaClassHelper used by the ClassConstants filter reader and
  882. optionally used by ejbjar for dependency determination
  883. </td>
  884. <td><a href="http://jakarta.apache.org/bcel/" target="_top">http://jakarta.apache.org/bcel/</a></td>
  885. </tr>
  886. <tr>
  887. <td>mail.jar</td>
  888. <td>Mail task with Mime encoding, and the MimeMail task</td>
  889. <td><a href="http://www.oracle.com/technetwork/java/index-jsp-139225.html"
  890. target="_top">http://www.oracle.com/technetwork/java/index-jsp-139225.html</a></td>
  891. </tr>
  892. <tr>
  893. <td>activation.jar</td>
  894. <td>Mail task with Mime encoding, and the MimeMail task</td>
  895. <td><a href="http://www.oracle.com/technetwork/java/javase/jaf-135115.html"
  896. target="_top">http://www.oracle.com/technetwork/java/javase/jaf-135115.html</a></td>
  897. </tr>
  898. <tr>
  899. <td>jdepend.jar</td>
  900. <td>jdepend task</td>
  901. <td><a href="http://www.clarkware.com/software/JDepend.html"
  902. target="_top">http://www.clarkware.com/software/JDepend.html</a></td>
  903. </tr>
  904. <tr>
  905. <td>resolver.jar <b>1.1beta or later</b></td>
  906. <td>xmlcatalog datatype <em>only if support for external catalog files is desired</em></td>
  907. <td><a href="http://xml.apache.org/commons/"
  908. target="_top">http://xml.apache.org/commons/</a>.</td>
  909. </tr>
  910. <tr>
  911. <td>jsch.jar <b>0.1.42 or later</b></td>
  912. <td>sshexec and scp tasks</td>
  913. <td><a href="http://www.jcraft.com/jsch/index.html"
  914. target="_top">http://www.jcraft.com/jsch/index.html</a></td>
  915. </tr>
  916. <tr>
  917. <td>JAI - Java Advanced Imaging</td>
  918. <td>image task</td>
  919. <td><a href="https://jai.dev.java.net/"
  920. target="_top">https://jai.dev.java.net/</a></td>
  921. </tr>
  922. </table>
  923. <br>
  924. <h2><a name="Troubleshooting">Troubleshooting</a></h2>
  925. <h3><a name="diagnostics">Diagnostics</a></h3>
  926. <p> Ant has a built in diagnostics feature. If you run <code>ant
  927. -diagnostics</code> ant will look at its internal state and print it out. This
  928. code will check and print the following things. </p>
  929. <ul>
  930. <li>Where Ant is running from. Sometimes you can be surprised.</li>
  931. <li>The version of ant.jar and of the ant-*.jar containing the optional tasks -
  932. and whether they match</li>
  933. <li>Which JAR files are in ANT_HOME/lib
  934. <li>Which optional tasks are available. If a task is not listed as being
  935. available, either it is not present, or libraries that it depends on are
  936. absent.</li>
  937. <li>XML Parser information</li>
  938. <li>JVM system properties
  939. </li>
  940. <li>The status of the temp directory. If this is not writeable, or its clock is
  941. horribly wrong (possible if it is on a network drive), a lot of tasks will fail
  942. with obscure error messages.</li>
  943. <li>The current time zone as Java sees it. If this is not what it should be for
  944. your location, then dependency logic may get confused.
  945. </ul>
  946. <p>
  947. Running <code>ant -diagnostics</code> is a good way to check that ant is
  948. installed. It is also a first step towards self-diagnosis of any problem.
  949. Any configuration problem reported to the user mailing list will probably
  950. result ins someone asking you to run the command and show the results, so
  951. save time by using it yourself.
  952. </p>
  953. <p>
  954. For under-IDE diagostics, use the &lt;diagnostics&gt; task to run the same
  955. tests as an ant task. This can be added to a diagnostics target in a build
  956. file to see what tasks are available under the IDE, what the XML parser and
  957. classpath is, etc.
  958. </p>
  959. <h3><a name="ant-user">user mailing list</a></h3>
  960. <p> If you cannot get Ant installed or working, the Ant user mailing list is the
  961. best place to start with any problem. Please do your homework first, make sure
  962. that it is not a <a href="#classpath"><code>CLASSPATH</code></a> problem, and run a <a
  963. href="#diagnostics">diagnostics check</a> to see what Ant thinks of its own
  964. state. Why the user list, and not the developer list?
  965. Because there are more users than developers, so more people who can help you. </p>
  966. <p>
  967. Please only file a bug report against Ant for a configuration/startup problem if
  968. there really is a fixable bug in Ant related to configuration, such as it not
  969. working on a particular platform, with a certain JVM version, etc, or if you are
  970. advised to do it by the user mailing list.
  971. </p>
  972. </body>
  973. </html>