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

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