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.

problems.html 19 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <html lang="en">
  17. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  18. <head>
  19. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  20. <title>Apache Ant - Having Problems?</title>
  21. <link type="text/css" href="./page.css" rel="stylesheet">
  22. <meta name="author" content="Conor MacNeill">
  23. <meta name="email" content="">
  24. </head>
  25. <body>
  26. <p class="navpath">
  27. <script src="./breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  28. </p>
  29. <div class="logobar">
  30. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  31. <tr>
  32. <td align="left"><img border="0" alt="Apache Ant site" src="./images/group-logo.gif"></td>
  33. <td align="center" width="100%"><img alt="Apache Ant logo" border="0" src="./images/project-logo.gif"></td>
  34. <td align="right">
  35. <form target="_blank" onsubmit="q.value = query.value + ' site:ant.apache.org'" action="http://www.google.com/search" method="get">
  36. <table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F">
  37. <tr>
  38. <td colspan="3"><img height="10" width="1" alt="" src="./images/spacer.gif"></td>
  39. </tr>
  40. <tr>
  41. <td><img height="1" width="1" alt="" src="./images/spacer.gif"></td>
  42. <td nowrap="nowrap" class="searchcaption">
  43. <input name="q" type="hidden">
  44. <input size="15" id="query" type="text">
  45. <img height="1" width="5" alt="" src="./images/spacer.gif">
  46. <input name="Search" value="Search" type="submit">
  47. <br>
  48. the Apache Ant site
  49. </td>
  50. <td><img height="1" width="1" alt="" src="./images/spacer.gif"></td>
  51. </tr>
  52. <tr>
  53. <td><img alt="" border="0" height="10" width="9" src="./images/search-left.gif"></td>
  54. <td><img height="1" width="1" alt="" src="./images/spacer.gif"></td>
  55. <td><img alt="" border="0" height="10" width="9" src="./images/search-right.gif"></td>
  56. </tr>
  57. </table>
  58. </form>
  59. </td>
  60. </tr>
  61. </table>
  62. </div>
  63. <div class="tab">
  64. <table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
  65. <tr>
  66. <td width="8"><img alt="" height="5" width="8" src="./images/spacer.gif"></td><td valign="bottom">
  67. <table summary="selected tab" style="height: 1.5em" border="0" cellpadding="0" cellspacing="0">
  68. <tr>
  69. <td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="./images/tabSel-left.gif"></td><td valign="middle" bgcolor="#4C6C8F"><font color="#ffffff" size="2" face="Arial, Helvetica, Sans-serif"><b>Home</b></font></td><td valign="top" width="5" bgcolor="#4C6C8F"><img height="5" width="5" alt="" src="./images/tabSel-right.gif"></td>
  70. </tr>
  71. </table>
  72. </td>
  73. <td width="5"><img alt="" height="8" width="8" src="./images/spacer.gif"></td><td valign="bottom">
  74. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  75. <tr>
  76. <td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="./images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="./projects/index.html"><font size="2" face="Arial, Helvetica, Sans-serif">Projects</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="./images/tab-right.gif"></td>
  77. </tr>
  78. </table>
  79. </td>
  80. </tr>
  81. </table>
  82. </div>
  83. <div class="bluebar"></div>
  84. <div class="menucontainer">
  85. <div class="menu">
  86. <ul>
  87. <li class="menuheader">Apache Ant
  88. <ul>
  89. <li>
  90. <a href="./index.html">Welcome</a>
  91. </li>
  92. <li>
  93. <a href="./license.html">License</a>
  94. </li>
  95. <li>
  96. <a href="./antnews.html">News</a>
  97. </li>
  98. </ul>
  99. </li>
  100. <li class="menuheader">Documentation
  101. <ul>
  102. <li>
  103. <a href="./manual/index.html">Manual</a>
  104. </li>
  105. <li>
  106. <a href="./projects.html">Related Projects</a>
  107. </li>
  108. <li>
  109. <a href="./external.html">External Tools and Tasks</a>
  110. </li>
  111. <li>
  112. <a href="./resources.html">Resources</a>
  113. </li>
  114. <li>
  115. <a href="./faq.html">Frequently Asked Questions</a>
  116. </li>
  117. <li>
  118. <a href="http://wiki.apache.org/ant/FrontPage">Wiki</a>
  119. </li>
  120. <li>
  121. <span class="sel">Having Problems?</span>
  122. </li>
  123. </ul>
  124. </li>
  125. <li class="menuheader">Download
  126. <ul>
  127. <li>
  128. <a href="http://ant.apache.org/bindownload.cgi">Binary Distributions</a>
  129. </li>
  130. <li>
  131. <a href="http://ant.apache.org/srcdownload.cgi">Source Distributions</a>
  132. </li>
  133. </ul>
  134. </li>
  135. <li class="menuheader">Contributing
  136. <ul>
  137. <li>
  138. <a href="./mail.html">Mailing Lists</a>
  139. </li>
  140. <li>
  141. <a href="./svn.html">Subversion Repositories</a>
  142. </li>
  143. <li>
  144. <a href="./nightlies.html">Nightly Builds</a>
  145. </li>
  146. <li>
  147. <a href="./bugs.html">Bug Database</a>
  148. </li>
  149. </ul>
  150. </li>
  151. <li class="menuheader">Sponsorship
  152. <ul>
  153. <li>
  154. <a href="http://www.apache.org/foundation/thanks.html">Thanks</a>
  155. </li>
  156. <li>
  157. <a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
  158. </li>
  159. <li>
  160. <a href="http://www.apache.org/foundation/contributing.html">Donations</a>
  161. </li>
  162. </ul>
  163. </li>
  164. <li class="menuheader">Project Management
  165. <ul>
  166. <li>
  167. <a href="./contributors.html">Contributors</a>
  168. </li>
  169. <li>
  170. <a href="./mission.html">Apache Ant Mission</a>
  171. </li>
  172. <li>
  173. <a href="./bylaws.html">Project Bylaws</a>
  174. </li>
  175. <li>
  176. <a href="./legal.html">Legal</a>
  177. </li>
  178. </ul>
  179. </li>
  180. </ul>
  181. </div>
  182. <center>
  183. <!--#include virtual="/ads/buttonbar.html" -->
  184. </center>
  185. <img style="float: left" height="10" width="10" border="0" alt="" src="./images/menu-left.gif">
  186. <img style="float: right" height="10" width="10" border="0" alt="" src="./images/menu-right.gif">
  187. </div>
  188. <div class="lightbluebar">&nbsp;</div>
  189. <div class="main">
  190. <div class="content">
  191. <h1 class="title">Having Problems?</h1>
  192. <h3 class="section">
  193. <a name="Having Problems?"></a>
  194. Having Problems?
  195. </h3>
  196. <p>
  197. This page details some steps you can take to try and resolve
  198. any problems you may be having with Ant. If you find you can't
  199. resolve the problem, then this page will help you collect some of
  200. the relevant information to provide in a bug report. This information
  201. will help the Ant developers understand and resolve the problem.
  202. Of course, not all the steps here will make sense for every problem
  203. you may encounter - these are just some suggestions to point
  204. you in the right direction.
  205. </p>
  206. <h4 class="subsection">
  207. <a name="Ensure that you are actually running the version of Ant that you think you do"></a>
  208. Ensure that you are actually running the version of Ant that you think you do
  209. </h4>
  210. <p>Many tools include a version of Ant and some Operating
  211. Systems even install it by default now, so you may have a
  212. version of Ant installed that you haven't been aware of.</p>
  213. <p>One of the first things to do is to run
  214. <br /><br />
  215. <font face="verdana" size="-1">ant -version</font>
  216. <br /><br />
  217. and
  218. <br /><br />
  219. <font face="verdana" size="-1">ant -diagnostics</font>
  220. <br /><br />
  221. to be sure. Also, we highly recommend that you run Ant with
  222. an empty CLASSPATH. If any other version of Ant can be
  223. loaded from the CLASSPATH, many types of errors may happen
  224. because of incompatible classes being loaded.</p>
  225. <p>See <a href="faq.html">the FAQ</a> for <a href="faq.html#NoClassDefFoundError">some</a> <a href="faq.html#InstantiationException">examples</a>, but many
  226. other problems are a result of an old version of Ant on your
  227. system as well.</p>
  228. <h4 class="subsection">
  229. <a name="Read the Manual"></a>
  230. Read the Manual
  231. </h4>
  232. <p>
  233. The first step to take when you have a problem with Ant is to read
  234. the <a href="manual/index.html">manual</a> entry for the task or
  235. concept that is giving you trouble. In particular, check the
  236. meaning of a task's attributes and nested elements. Perhaps an
  237. attribute is available that would provide the behavior you require.
  238. If you have problems with the manual itself, you can submit a
  239. documentation bug report (see below) to help us improve the Ant
  240. documentation.
  241. </p>
  242. <h4 class="subsection">
  243. <a name="Examine Debug Output"></a>
  244. Examine Debug Output
  245. </h4>
  246. <p>
  247. If you're still having a problem, the next step is to try and
  248. gather additional information about what Ant is doing.
  249. Try running Ant with the <code>verbose</code> flag:
  250. <br /><br />
  251. <font face="verdana" size="-1">ant -verbose</font>
  252. <br /><br />
  253. or
  254. <br /><br />
  255. <font face="verdana" size="-1">ant -v</font>
  256. <br /><br />
  257. This will produce output that starts like the following:</p>
  258. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  259. <tr>
  260. <td colspan="1" rowspan="1"
  261. valign="top" align="left">
  262. Ant version 1.4.1 compiled on October 11 2001<br />
  263. Buildfile: build.xml<br />
  264. Detected Java version: 1.3 in: D:\usr\local\java\jdk13\jre<br />
  265. Detected OS: Windows NT<br />
  266. parsing buildfile D:\ant\build.xml
  267. with URI = file:D:/ant/build.xml<br />
  268. Project base dir set to: D:\ant<br />
  269. ��[property] Loading Environment env.<br />
  270. ��[property] Loading D:\ant\conf.properties<br />
  271. Build sequence for target 'debug' is [debug]<br />
  272. Complete build sequence is [debug, gensrc, compile, jar, test]<br />
  273. . . .<br />
  274. </td>
  275. </tr>
  276. </table>
  277. <p>
  278. You should be able to see from the trace more about what Ant
  279. is doing and why it's taking a particular course of action.
  280. If you need even more information, you can use the
  281. <code>-debug</code> flag rather than
  282. <code>-verbose</code>.
  283. This will generally produce so much
  284. output that you may want to save the output to a file and
  285. analyze it in an editor. You can save the output using the
  286. <code>-logfile &lt;filename&gt;</code> flag, or
  287. using redirection.
  288. </p>
  289. <p>
  290. Once you have all this debug information, how can you use it
  291. to solve your problem? That will depend on the task in question
  292. and the nature of your problem. Each task logs different aspects
  293. of its operation, but it should give you an idea of what is going
  294. on. For example, the <code>&lt;javac&gt;</code> task logs the
  295. reasons why it
  296. chooses to compile particular class files and not others, along
  297. with which compiler it is using and the arguments it will pass
  298. to that compiler. The following partial trace shows why
  299. <code>&lt;javac&gt;</code> is adding one class file but
  300. skipping another.
  301. This is followed by which compiler it will be using, the
  302. arguments that will get passed to the compiler,
  303. and a list of all the class files to be compiled.
  304. </p>
  305. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  306. <tr>
  307. <td colspan="1" rowspan="1"
  308. valign="top" align="left">
  309. [javac] Test.java omitted as D:\classes\Test.class is up to date.<br />
  310. [javac] Unset.java added as D:\classes\Unset.class is outdated.<br />
  311. [javac] Compiling 1 source file to D:\classes<br />
  312. [javac] Using classic compiler<br />
  313. [javac] Compilation args: -d D:\classes -classpath D:\classes;<br />
  314. D:\jdk118\classes.zip; -sourcepath D:\src\java -g:none<br />
  315. [javac] File to be compiled:<br />
  316. D:\src\java\Unset.java<br />
  317. </td>
  318. </tr>
  319. </table>
  320. <p>
  321. In many cases, Ant tasks are wrappers around OS commands or
  322. other Java classes. In debug mode, many of these tasks will
  323. print out the equivalent command line, as the
  324. <code>&lt;javac&gt;</code> task
  325. output does. If you are having a problem, it is often useful to
  326. run the command directly from the command line, in the same way
  327. Ant is running it, and see if the problem occurs from there
  328. as well. The problem may be in the command that is being run,
  329. or it may be in the way the Ant task is running the command.
  330. You can also see the effect of changing attribute values on the
  331. generated command line. This can help you to understand whether
  332. you are using the correct attributes and values.
  333. </p>
  334. <h4 class="subsection">
  335. <a name="Has It Been Fixed?"></a>
  336. Has It Been Fixed?
  337. </h4>
  338. <p>
  339. After examining the debug output, if you still believe that the
  340. problem you are having is caused by Ant, chances are that someone
  341. else may have already encountered this problem, and perhaps it has
  342. been fixed. The next step, therefore, would be to download the
  343. sources of ant, see <a href="svn.html">svn</a>.
  344. </p>
  345. <p>
  346. <a href="http://vmgump.apache.org/gump/public/index.html">Gump</a>
  347. is building ant every night and using the ant built from the
  348. latest source to build a long list of open source projects. However,
  349. the version of ant built by gump is not available for download. Even
  350. if it were, it would not include most of the optional tasks.
  351. </p>
  352. <p>
  353. We currently do not have nightly builds including the optional tasks.
  354. </p>
  355. <h3 class="section">
  356. <a name="bugs"></a>
  357. bugs
  358. </h3>
  359. <p>If you are convinced that you have identified an unfixed bug, please turn to
  360. our document concerning the <a href="bugs.html">bug database</a>.</p>
  361. </div>
  362. </div>
  363. <p class="copyright">
  364. <script type="text/javascript" language="JavaScript"><!--
  365. document.write(" - "+"Last Published: " + document.lastModified);
  366. // -->
  367. </script>
  368. </p>
  369. </body>
  370. </html>