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

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