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

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