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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h1>Installing Ant</h1>
  8. <h2><a name="getting">Getting Ant</a></h2>
  9. <h3>Binary edition</h3>
  10. <p>The latest stable version of Ant can be downloaded from <a
  11. href="http://jakarta.apache.org/builds/ant/release/v1.3/bin/">
  12. http://jakarta.apache.org/builds/ant/release/v1.3/bin/</a>.
  13. If you like living on the edge, you can download the latest version from <a
  14. href="http://jakarta.apache.org/builds/ant/nightly/">http://jakarta.apache.org/builds/ant/nightly/</a>.</p>
  15. <h3>Source Edition</h3>
  16. <p>If you prefer the source edition, you can download the source for the latest Ant release from <a
  17. href="http://jakarta.apache.org/builds/ant/release/v1.3/src/">
  18. http://jakarta.apache.org/builds/ant/release/v1.3/src/</a>.
  19. Again, if you prefer the edge, you can access
  20. the code as it is being developed via CVS. The Jakarta website has details on
  21. <a href="http://jakarta.apache.org/site/cvsindex.html" target="_top">accessing CVS</a>. Please checkout the
  22. jakarta-ant module.
  23. See the section <a href="#buildingant">Building Ant</a> on how to
  24. build Ant from the source code.
  25. You can also access the
  26. <a href="http://cvs.apache.org/viewcvs/jakarta-ant/" target="_top">
  27. Ant CVS repository</a> on-line. </p>
  28. <hr>
  29. <h2><a name="sysrequirements">System Requirements</a></h2>
  30. <p>
  31. To build and use Ant, you must have a JAXP-compliant XML parser installed and
  32. available on your classpath.</p>
  33. <p>
  34. The binary distribution of Ant includes the reference
  35. implementation of JAXP 1.1. Please see
  36. <a href="http://java.sun.com/xml/" target="_top">http://java.sun.com/xml/</a>
  37. for more information.
  38. If you wish to use a different JAXP-compliant parser, you should remove
  39. <code>jaxp.jar</code> and <code>crimson.jar</code>
  40. from Ant's <code>lib</code> directory.
  41. You can then either put the jars from your preferred parser into Ant's
  42. <code>lib</code> directory or put the jars on the system classpath.</p>
  43. <p>
  44. For the current version of Ant, you will also need a JDK installed on
  45. your system, version 1.1 or later. A future version of Ant will require
  46. JDK 1.2 or later.
  47. </p>
  48. <hr>
  49. <h2><a name="installing">Installing Ant</a></h2>
  50. <p>The binary distribution of Ant consists of three directories:
  51. <code>bin</code>,
  52. <code>docs</code> and
  53. <code>lib</code>
  54. Only the <code>bin</code> and <code>lib</code> directories are
  55. required to run Ant.
  56. To install Ant, choose a directory and copy the distribution
  57. file there. This directory will be known as ANT_HOME.
  58. <br>
  59. <table width="80%">
  60. <tr>
  61. <td colspan="2">
  62. <b>Windows 95 and Windows 98 Note:</b>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td width="5%">&nbsp;</td>
  67. <td><i>
  68. On these systems, the script used to launch Ant will have
  69. problems if ANT_HOME is a long filename. This is due to
  70. limitations in the OS's handling of the <code>&quot;for&quot;</code>
  71. batch-file statement. It is recommended, therefore, that Ant be
  72. installed in a <b>short</b> path, such as C:\Ant.</i>
  73. </td>
  74. </tr>
  75. </table>
  76. <br>
  77. Before you can run ant there is some additional set up you
  78. will need to do:</p>
  79. <ul>
  80. <li>Add the <code>bin</code> directory to your path.</li>
  81. <li>Set the <code>ANT_HOME</code> environment variable to the
  82. directory where you installed Ant. On some operating systems the ant
  83. wrapper scripts can guess <code>ANT_HOME</code> (Unix dialects and
  84. Windows NT/2000) - but it is better to not rely on this behavior.</li>
  85. <li>Optionally, set the <code>JAVA_HOME</code> environment variable
  86. (see the <a href="#advanced">Advanced</a> section below).
  87. This should be set to the directory where your JDK is installed.</li>
  88. </ul>
  89. <p><strong>Note:</strong> Do not install Ant's ant.jar file into the lib/ext
  90. directory of the JDK/JRE. Ant is an application, whilst the extension
  91. directory is intended for JDK extensions. In particular there are security
  92. restrictions on the classes which may be loaded by an extension.</p>
  93. <h3>Optional Tasks</h3>
  94. <p>Ant supports a number of optional tasks. An optional task is a task which
  95. typically requires an external library to function. The optional tasks are
  96. packaged separately from the core Ant tasks. This package is available in
  97. the same download directory as the core ant distribution. The current
  98. jar containing optional tasks is named <code>jakarta-ant-1.3-optional.jar</code>.
  99. This jar should be downloaded and placed in the lib directory of your Ant
  100. installation.</p>
  101. <p>The external libraries required by each of the optional tasks is detailed
  102. in the <a href="#librarydependencies">Library Dependencies</a> section. These external
  103. libraries may either be placed in Ant's lib directory, where they will be picked up
  104. automatically, or made available on the system CLASSPATH environment variable.
  105. </p>
  106. <h3>Windows</h3>
  107. <p>Assume Ant is installed in <code>c:\ant\</code>. The following sets up the
  108. environment:</p>
  109. <pre>set ANT_HOME=c:\ant
  110. set JAVA_HOME=c:\jdk1.2.2
  111. set PATH=%PATH%;%ANT_HOME%\bin</pre>
  112. <h3>Unix (bash)</h3>
  113. <p>Assume Ant is installed in <code>/usr/local/ant</code>. The following sets up
  114. the environment:</p>
  115. <pre>export ANT_HOME=/usr/local/ant
  116. export JAVA_HOME=/usr/local/jdk-1.2.2
  117. export PATH=${PATH}:${ANT_HOME}/bin</pre>
  118. <h3><a name="advanced">Advanced</a></h3>
  119. <p>There are lots of variants that can be used to run Ant. What you need is at
  120. least the following:</p>
  121. <ul>
  122. <li>The classpath for Ant must contain <code>ant.jar</code> and any jars/classes
  123. needed for your chosen JAXP-compliant XML parser.</li>
  124. <li>When you need JDK functionality
  125. (such as for the <a href="CoreTasks/javac.html">javac</a> task or the
  126. <a href="CoreTasks/rmic.html">rmic</a> task), then for JDK 1.1, the <code>classes.zip</code>
  127. file of the JDK must be added to the classpath; for JDK 1.2 or JDK 1.3, <code>tools.jar</code>
  128. must be added. The scripts supplied with Ant,
  129. in the <code>bin</code> directory, will add
  130. the required JDK classes automatically, if the <code>JAVA_HOME</code>
  131. environment variable is set.</li>
  132. <li>When you are executing platform-specific applications, such as the
  133. <a href="CoreTasks/exec.html">exec</a> task or the
  134. <a href="CoreTasks/cvs.html">cvs</a> task, the property <code>ant.home</code>
  135. must be set to the directory containing where you installed Ant. Again
  136. this is set by the Ant scripts to the value of the ANT_HOME environment
  137. variable.</li>
  138. </ul>
  139. <hr>
  140. <h2><a name="buildingant">Building Ant</a></h2>
  141. <p>To build Ant from source, you can either install the Ant source distribution
  142. or checkout the jakarta-ant module from CVS.</p>
  143. <p>Once you have installed the source, change into the installation
  144. directory.</p>
  145. <p>Set the <code>JAVA_HOME</code> environment variable
  146. to the directory where the JDK is installed.
  147. See <a href="#installing">Installing Ant</a>
  148. for examples on how to do this for your operating system. </p>
  149. <p>Make sure you have downloaded any auxiliary jars required to
  150. build tasks you are interested in. These should either be available
  151. on the CLASSPATH or added to the <code>lib/optional</code>
  152. directory.
  153. See <a href="#librarydependencies">Library Dependencies</a>
  154. for a list of jar requirements for various features.
  155. Note that this will make the auxiliary jars
  156. available for the building of Ant only. For running Ant you will
  157. still need to
  158. make the jars available as described under
  159. <a href="#installing">Installing Ant</a>.</p>
  160. <p>Your are now ready to build Ant:</p>
  161. <blockquote>
  162. <p><code>build -Ddist.dir=&lt;<i>directory_to_contain_Ant_distribution</i>&gt; dist</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  163. <p><code>build.sh -Ddist.dir=&lt;<i>directory_to_contain_Ant_distribution</i>&gt; dist</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  164. </blockquote>
  165. <p>This will create a binary distribution of Ant in the directory you specified.</p>
  166. <p>The above action does the following:</p>
  167. <ul>
  168. <li>If necessary it will bootstrap the Ant code. Bootstrapping involves the manual
  169. compilation of enough Ant code to be able to run Ant. The bootstrapped Ant is
  170. used for the remainder of the build steps. </li>
  171. <li>Invokes the bootstrapped Ant with the parameters passed to the build script. In
  172. this case, these parameters define an Ant property value and specify the &quot;dist&quot; target
  173. in Ant's own <code>build.xml</code> file.
  174. </ul>
  175. <p>On most occasions you will not need to explicitly bootstrap Ant since the build
  176. scripts do that for you. If however, the build file you are using makes use of features
  177. not yet compiled into the bootstrapped Ant, you will need to manually bootstrap.
  178. Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX)
  179. to build a new bootstrap version of Ant.</p>
  180. If you wish to install the build into the current <code>ANT_HOME</code>
  181. directory, you can use:
  182. <blockquote>
  183. <p><code>build install</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  184. <p><code>build.sh install</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  185. </blockquote>
  186. You can avoid the lengthy Javadoc step, if desired, with:
  187. <blockquote>
  188. <p><code>build install-lite</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  189. <p><code>build.sh install-lite</code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
  190. </blockquote>
  191. This will only install the <code>bin</code> and <code>lib</code> directories.
  192. <p>Both the <code>install</code> and
  193. <code>install-lite</code> targets will overwrite
  194. the current Ant version in <code>ANT_HOME</code>.</p>
  195. <hr>
  196. <h2><a name="librarydependencies">Library Dependencies</a></h2>
  197. <p>The following libraries are needed in your CLASSPATH or in the
  198. install directory's <code>lib</code> directory if you are using the
  199. indicated feature. Note that only one of the regexp libraries is
  200. needed for use with the mappers. You will also need to install the
  201. Ant optional jar containing the task definitions to make these
  202. tasks available. Please refer to the <a href="#installing">
  203. Installing Ant</a> section above.</p>
  204. <table border="1" cellpadding="2" cellspacing="0">
  205. <tr>
  206. <td><b>Jar Name</b></td>
  207. <td><b>Needed For</b></td>
  208. <td><b>Available At</b></td>
  209. </tr>
  210. <tr>
  211. <td>An XSL transformer like Xalan or XSL:P</td>
  212. <td>style task</td>
  213. <td><a href="http://xml.apache.org/xalan-j/index.html"
  214. target="_top">http://xml.apache.org/xalan-j/index.html</a> or <a
  215. href="http://www.clc-marketing.com/xslp/"
  216. target="_top">http://www.clc-marketing.com/xslp/</a></td>
  217. </tr>
  218. <tr>
  219. <td>jakarta-regexp-1.2.jar</td>
  220. <td>regexp type with mappers</td>
  221. <td><a href="http://jakarta.apache.org/regexp/" target="_top">jakarta.apache.org/regexp/</a></td>
  222. </tr>
  223. <tr>
  224. <td>jakarta-oro-2.0.1.jar</td>
  225. <td>regexp type with mappers and the perforce tasks</td>
  226. <td><a href="http://jakarta.apache.org/oro/" target="_top">jakarta.apache.org/oro/</a></td>
  227. </tr>
  228. <tr>
  229. <td>junit.jar</td>
  230. <td>junit tasks</td>
  231. <td><a href="http://www.junit.org/" target="_top">www.junit.org</a></td>
  232. </tr>
  233. <tr>
  234. <td>stylebook.jar</td>
  235. <td>stylebook task</td>
  236. <td>CVS repository of <a href="http://xml.apache.org" target="_top">xml.apache.org</a></td>
  237. </tr>
  238. <tr>
  239. <td>testlet.jar</td>
  240. <td>test task</td>
  241. <td><a href="http://java.apache.org/framework" target="_top">java.apache.org/framework</a></td>
  242. </tr>
  243. <tr>
  244. <td>antlr.jar</td>
  245. <td>antlr task</td>
  246. <td><a href="http://www.antlr.org/" target="_top">www.antlr.org</a></td>
  247. </tr>
  248. <tr>
  249. <td >bsf.jar</td>
  250. <td>script task</td>
  251. <td><a href="http://oss.software.ibm.com/developerworks/projects/bsf" target="_top">
  252. oss.software.ibm.com/developerworks/projects/bsf</a></td>
  253. </tr>
  254. <tr>
  255. <td>netrexx.jar</td>
  256. <td>netrexx task</td>
  257. <td><a href="http://www2.hursley.ibm.com/netrexx" target="_top">
  258. www2.hursley.ibm.com/netrexx</a></td>
  259. </tr>
  260. <tr>
  261. <td>rhino.jar</td>
  262. <td>javascript with script task</td>
  263. <td><a href="http://www.mozilla.org/" target="_top">www.mozilla.org</a></td>
  264. </tr>
  265. <tr>
  266. <td>jpython.jar</td>
  267. <td>python with script task</td>
  268. <td><a href="http://www.jpython.org/" target="_top">www.jpython.org</a></td>
  269. </tr>
  270. <tr>
  271. <td>netcomponents.jar</td>
  272. <td>ftp and telnet tasks</td>
  273. <td><a href="http://www.savarese.org/oro/downloads/index.html#NetComponents"
  274. target="_top">www.savarese.org/oro/downloads</a></td>
  275. </tr>
  276. </table>
  277. <br>
  278. <hr>
  279. <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  280. Reserved.</p>
  281. </body>
  282. </html>