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

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