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.

javac.html 23 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. <html lang="en-us">
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Javac Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="javac">Javac</a></h2>
  8. <h3>Description</h3>
  9. <p>Compiles a Java source tree.</p>
  10. <p>The source and destination directory will be recursively scanned for Java
  11. source files to compile. Only Java files that have no corresponding
  12. <code>.class</code> file
  13. or where the class file is older than the
  14. <code>.java</code> file will be compiled.</p>
  15. <p>Note: Ant uses only the names of the source and class files to find
  16. the classes that need a rebuild. It will not scan the source and therefore
  17. will have no knowledge about nested classes, classes that are named different
  18. from the source file, and so on. See the
  19. <a href="../OptionalTasks/depend.html"><code>&lt;depend&gt;</code></a> task
  20. for dependency checking based on other than just
  21. existence/modification times.</p>
  22. <p>When the source files are part of a package, the directory structure of
  23. the source tree should follow the package
  24. hierarchy.</p>
  25. <p>It is possible to refine the set of files that are being compiled.
  26. This can be done with the <code>includes</code>, <code>includesfile</code>,
  27. <code>excludes</code>, and <code>excludesfile</code>
  28. attributes. With the <code>includes</code> or
  29. <code>includesfile</code> attribute, you specify the files you want to
  30. have included.
  31. The <code>exclude</code> or <code>excludesfile</code> attribute is used
  32. to specify
  33. the files you want to have excluded. In both cases, the list of files
  34. can be specified by either the filename, relative to the directory(s) specified
  35. in the <code>srcdir</code> attribute or nested <code>&lt;src&gt;</code>
  36. element(s), or by using wildcard patterns. See the section on
  37. <a href="../dirtasks.html#directorybasedtasks">directory-based tasks</a>,
  38. for information on how the
  39. inclusion/exclusion of files works, and how to write wildcard patterns.</p>
  40. <p>It is possible to use different compilers. This can be specified by
  41. either setting the global <code>build.compiler</code> property, which will
  42. affect all <code>&lt;javac&gt;</code> tasks throughout the build, or by
  43. setting the <code>compiler</code> attribute, specific to the current
  44. <code>&lt;javac&gt;</code> task.
  45. <a name="compilervalues">Valid values for either the
  46. <code>build.compiler</code> property or the <code>compiler</code>
  47. attribute are:</a></p>
  48. <ul>
  49. <li><code>classic</code> (the standard compiler of JDK 1.1/1.2) &ndash;
  50. <code>javac1.1</code> and
  51. <code>javac1.2</code> can be used as aliases.</li>
  52. <li><code>modern</code> (the standard compiler of JDK 1.3/1.4) &ndash;
  53. <code>javac1.3</code> and
  54. <code>javac1.4</code> can be used as aliases.</li>
  55. <li><code>jikes</code> (the <a
  56. href="http://oss.software.ibm.com/developerworks/opensource/jikes/" target="_top">Jikes</a>
  57. compiler).</li>
  58. <li><code>jvc</code> (the Command-Line Compiler from Microsoft's SDK
  59. for Java / Visual J++) &ndash; <code>microsoft</code> can be used
  60. as an alias.</li>
  61. <li><code>kjc</code> (the <a href="http://www.dms.at/kopi/" target="_top">kopi</a>
  62. compiler).</li>
  63. <li><code>gcj</code> (the gcj compiler from gcc).</li>
  64. <li><code>sj</code> (Symantec java compiler) &ndash;
  65. <code>symantec</code> can be used as an alias.</li>
  66. <li><code>extJavac</code> (run either modern or classic in a JVM of
  67. its own).</li>
  68. </ul>
  69. <p>The default is <code>javac1.x</code> with <code>x</code> depending
  70. on the JDK version you use while you are running Ant.
  71. If you wish to use a different compiler interface than those
  72. supplied, you can write a class that implements the CompilerAdapter interface
  73. (<code>package org.apache.tools.ant.taskdefs.compilers</code>). Supply the full
  74. classname in the <code>build.compiler</code> property or the
  75. <code>compiler</code> attribute.
  76. </p>
  77. <p>The fork attribute overrides the <code>build.compiler</code> property
  78. or <code>compiler</code> attribute setting and
  79. expects a JDK1.1 or higher to be set in <code>JAVA_HOME</code>.
  80. </p>
  81. <p>You can also use the <code>compiler</code> attribute to tell Ant
  82. which JDK version it shall assume when it puts together the command
  83. line switches - even if you set <code>fork=&quot;true&quot;</code>.
  84. This is useful if you want to run the compiler of JDK 1.1 while you
  85. current JDK is 1.2+. If you use
  86. <code>compiler=&quot;javac1.1&quot;</code> and (for example)
  87. <code>depend=&quot;true&quot;</code> Ant will use the command line
  88. switch <code>-depend</code> instead of <code>-Xdepend</code>.</p>
  89. <p>This task will drop all entries that point to non-existent
  90. files/directories from the classpath it passes to the compiler.</p>
  91. <p><strong>Windows Note:</strong>When the modern compiler is used
  92. in unforked mode on Windows, it locks up the files present in the
  93. classpath of the <code>&lt;javac&gt;</code> task, and does not release them.
  94. The side effect of this is that you will not be able to delete or move
  95. those files later on in the build. The workaround is to fork when
  96. invoking the compiler.</p>
  97. <h3>Parameters</h3>
  98. <table border="1" cellpadding="2" cellspacing="0">
  99. <tr>
  100. <td valign="top"><b>Attribute</b></td>
  101. <td valign="top"><b>Description</b></td>
  102. <td align="center" valign="top"><b>Required</b></td>
  103. </tr>
  104. <tr>
  105. <td valign="top">srcdir</td>
  106. <td valign="top">Location of the java files. (See the
  107. <a href="#srcdirnote">note</a> below.)</td>
  108. <td align="center" valign="top">Yes, unless nested <code>&lt;src&gt;</code> elements are present.</td>
  109. </tr>
  110. <tr>
  111. <td valign="top">destdir</td>
  112. <td valign="top">Location to store the class files.</td>
  113. <td align="center" valign="top">No</td>
  114. </tr>
  115. <tr>
  116. <td valign="top">includes</td>
  117. <td valign="top">Comma- or space-separated list of files (may be specified using
  118. wildcard patterns) that must be
  119. included; all <code>.java</code> files are included when omitted.</td>
  120. <td valign="top" align="center">No</td>
  121. </tr>
  122. <tr>
  123. <td valign="top">includesfile</td>
  124. <td valign="top">The name of a file that contains a list of files to
  125. include (may be specified using wildcard patterns).</td>
  126. <td valign="top" align="center">No</td>
  127. </tr>
  128. <tr>
  129. <td valign="top">excludes</td>
  130. <td valign="top">Comma- or space-separated list of files (may be specified using
  131. wildcard patterns) that must be excluded; no files (except default
  132. excludes) are excluded when omitted.</td>
  133. <td valign="top" align="center">No</td>
  134. </tr>
  135. <tr>
  136. <td valign="top">excludesfile</td>
  137. <td valign="top">The name of a file that contains a list of files to
  138. exclude (may be specified using wildcard patterns).</td>
  139. <td valign="top" align="center">No</td>
  140. </tr>
  141. <tr>
  142. <td valign="top">classpath</td>
  143. <td valign="top">The classpath to use.</td>
  144. <td align="center" valign="top">No</td>
  145. </tr>
  146. <tr>
  147. <td valign="top">sourcepath</td>
  148. <td valign="top">The sourcepath to use; defaults to the value of the srcdir attribute (or nested <code>&lt;src&gt;</code> elements).
  149. To suppress the sourcepath switch, use <code>sourcepath=&quot;&quot;</code>.</td>
  150. <td align="center" valign="top">No</td>
  151. </tr>
  152. <tr>
  153. <td valign="top">bootclasspath</td>
  154. <td valign="top">Location of bootstrap class files.</td>
  155. <td align="center" valign="top">No</td>
  156. </tr>
  157. <tr>
  158. <td valign="top">classpathref</td>
  159. <td valign="top">The classpath to use, given as a
  160. <a href="../using.html#references">reference</a> to a path defined elsewhere.</td>
  161. <td align="center" valign="top">No</td>
  162. </tr>
  163. <tr>
  164. <td valign="top">sourcepathref</td>
  165. <td valign="top">The sourcepath to use, given as a
  166. <a href="../using.html#references">reference</a> to a path defined elsewhere.</td>
  167. <td align="center" valign="top">No</td>
  168. </tr>
  169. <tr>
  170. <td valign="top">bootclasspathref</td>
  171. <td valign="top">Location of bootstrap class files, given as a
  172. <a href="../using.html#references">reference</a> to a path defined elsewhere.</td>
  173. <td align="center" valign="top">No</td>
  174. </tr>
  175. <tr>
  176. <td valign="top">extdirs</td>
  177. <td valign="top">Location of installed extensions.</td>
  178. <td align="center" valign="top">No</td>
  179. </tr>
  180. <tr>
  181. <td valign="top">encoding</td>
  182. <td valign="top">Encoding of source files. (Note: gcj doesn't support
  183. this option yet.)</td>
  184. <td align="center" valign="top">No</td>
  185. </tr>
  186. <tr>
  187. <td valign="top">nowarn</td>
  188. <td valign="top">Indicates whether the <code>-nowarn</code> switch
  189. should be passed to the compiler; defaults to <code>off</code>.</td>
  190. <td align="center" valign="top">No</td>
  191. </tr>
  192. <tr>
  193. <td valign="top">debug</td>
  194. <td valign="top">Indicates whether source should be compiled with
  195. debug information; defaults to <code>off</code>. If set to
  196. <code>off</code>, <code>-g:none</code> will be passed on the
  197. command line for compilers that support it (for other compilers, no
  198. command line argument will be used). If set to <code>true</code>,
  199. the value of the <code>debuglevel</code> attribute determines the
  200. command line argument.</td>
  201. <td align="center" valign="top">No</td>
  202. </tr>
  203. <tr>
  204. <td valign="top">debuglevel</td>
  205. <td valign="top">Keyword list to be appended to the <code>-g</code>
  206. command-line switch. This will be ignored by all implementations except
  207. <code>modern</code> and <code>classic(ver &gt;= 1.2)</code>.
  208. Legal values are <code>none</code> or a comma-separated list of the
  209. following keywords:
  210. <code>lines</code>, <code>vars</code>, and <code>source</code>.
  211. If <code>debuglevel</code> is not specified, by default,
  212. nothing will be
  213. appended to <code>-g</code>. If <code>debug</code> is not turned on,
  214. this attribute will be ignored.
  215. </td>
  216. <td align="center" valign="top">No</td>
  217. </tr>
  218. <tr>
  219. <td valign="top">optimize</td>
  220. <td valign="top">Indicates whether source should be compiled with
  221. optimization; defaults to <code>off</code>.</td>
  222. <td align="center" valign="top">No</td>
  223. </tr>
  224. <tr>
  225. <td valign="top">deprecation</td>
  226. <td valign="top">Indicates whether source should be compiled with
  227. deprecation information; defaults to <code>off</code>.</td>
  228. <td align="center" valign="top">No</td>
  229. </tr>
  230. <tr>
  231. <td valign="top">target</td>
  232. <td valign="top">Generate class files for specific VM version
  233. (e.g., <code>1.1</code> or <code>1.2</code>). <b>Note that the
  234. default value depends on the JVM that is running Ant. In
  235. particular, if you use JDK 1.4 the generated classes will not be
  236. usable for a 1.1 Java VM unless you explicitly set this attribute
  237. to the value 1.1 (which is the default value for JDK 1.1 to
  238. 1.3).</b></td>
  239. <td align="center" valign="top">No</td>
  240. </tr>
  241. <tr>
  242. <td valign="top">verbose</td>
  243. <td valign="top">Asks the compiler for verbose output.</td>
  244. <td align="center" valign="top">No</td>
  245. </tr>
  246. <tr>
  247. <td valign="top">depend</td> <td valign="top">Enables dependency-tracking
  248. for compilers that support this (<code>jikes</code> and
  249. <code>classic</code>).</td>
  250. <td align="center" valign="top">No</td>
  251. </tr>
  252. <tr>
  253. <td valign="top">includeAntRuntime</td>
  254. <td valign="top">Whether to include the Ant run-time libraries in the
  255. classpath; defaults to <code>yes</code>.</td>
  256. <td align="center" valign="top">No</td>
  257. </tr>
  258. <tr>
  259. <td valign="top">includeJavaRuntime</td>
  260. <td valign="top">Whether to include the default run-time
  261. libraries from the executing VM in the classpath;
  262. defaults to <code>no</code>.</td>
  263. <td align="center" valign="top">No</td>
  264. </tr>
  265. <tr>
  266. <td valign="top">fork</td>
  267. <td valign="top">Whether to execute <code>javac</code> using the
  268. JDK compiler externally; defaults to <code>no</code>.</td>
  269. <td align="center" valign="top">No</td>
  270. </tr>
  271. <tr>
  272. <td valign="top">executable</td>
  273. <td valign="top">Complete path to the <code>javac</code>
  274. executable to use in case of <code>fork=&quot;yes&quot;</code>.
  275. Defaults to the compiler of the Java version that is currently
  276. running Ant. Ignored if <code>fork=&quot;no&quot;</code>.<br>
  277. Since Ant 1.6 this attribute can also be used to specify the
  278. path to the executable when using jikes, jvc, gcj or sj.</td>
  279. <td align="center" valign="top">No</td>
  280. </tr>
  281. <tr>
  282. <td valign="top">memoryInitialSize</td>
  283. <td valign="top">The initial size of the memory for the underlying VM,
  284. if <code>javac</code> is run externally; ignored otherwise. Defaults
  285. to the standard VM memory setting.
  286. (Examples: <code>83886080</code>, <code>81920k</code>, or
  287. <code>80m</code>)</td>
  288. <td align="center" valign="top">No</td>
  289. </tr>
  290. <tr>
  291. <td valign="top">memoryMaximumSize</td>
  292. <td valign="top">The maximum size of the memory for the underlying VM,
  293. if <code>javac</code> is run externally; ignored otherwise. Defaults
  294. to the standard VM memory setting.
  295. (Examples: <code>83886080</code>, <code>81920k</code>, or
  296. <code>80m</code>)</td>
  297. <td align="center" valign="top">No</td>
  298. </tr>
  299. <tr>
  300. <td valign="top">failonerror</td> <td valign="top">
  301. Indicates whether the build will continue even if there are compilation errors; defaults to <code>true</code>.
  302. </td>
  303. <td align="center" valign="top">No</td>
  304. </tr>
  305. <tr>
  306. <td valign="top">source</td>
  307. <td valign="top">Value of the <code>-source</code> command-line
  308. switch; will be ignored by all implementations except
  309. <code>javac1.4</code> (or <code>modern</code> when Ant is not
  310. running in a 1.3 VM) and <code>jikes</code>.<br> If you use this
  311. attribute together with <code>jikes</code>, you must make sure
  312. that your version of jikes supports the <code>-source</code>
  313. switch.<br> Legal values are <code>1.3</code> and <code>1.4</code>
  314. &ndash; by default, no <code>-source</code> argument will be used
  315. at all.</td>
  316. <td align="center" valign="top">No</td>
  317. </tr>
  318. <tr>
  319. <td valign="top">compiler</td>
  320. <td valign="top">The compiler implementation to use.
  321. If this attribute is not set, the value of the
  322. <code>build.compiler</code> property, if set, will be used.
  323. Otherwise, the default compiler for the current VM will be used.
  324. (See the above <a href="#compilervalues">list</a> of valid
  325. compilers.)</td>
  326. <td align="center" valign="top">No</td>
  327. </tr>
  328. <tr>
  329. <td valign="top">listfiles</td>
  330. <td valign="top">Indicates whether the source files to be compiled will
  331. be listed; defaults to <code>no</code>.</td>
  332. <td align="center" valign="top">No</td>
  333. </tr>
  334. <tr>
  335. <td valign="top">tempdir</td>
  336. <td valign="top">Where Ant should place temporary files.
  337. <em>Since Ant 1.6</em>.</td>
  338. <td align="center" valign="top">No; default is the current working
  339. directory.</td>
  340. </tr>
  341. </table>
  342. <h3>Parameters specified as nested elements</h3>
  343. <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
  344. supports all attributes of <code>&lt;fileset&gt;</code>
  345. (<code>dir</code> becomes <code>srcdir</code>) as well as the nested
  346. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  347. <code>&lt;patternset&gt;</code> elements.</p>
  348. <h4><code>src</code>, <code>classpath</code>, <code>sourcepath</code>,
  349. <code>bootclasspath</code> and <code>extdirs</code></h4>
  350. <p><code>&lt;javac&gt;</code>'s <code>srcdir</code>, <code>classpath</code>,
  351. <code>sourcepath</code>, <code>bootclasspath</code>, and
  352. <code>extdirs</code> attributes are
  353. <a href="../using.html#path">path-like structures</a>
  354. and can also be set via nested
  355. <code>&lt;src&gt;</code>,
  356. <code>&lt;classpath&gt;</code>,
  357. <code>&lt;sourcepath&gt;</code>,
  358. <code>&lt;bootclasspath&gt;</code> and
  359. <code>&lt;extdirs&gt;</code> elements, respectively.</p>
  360. <h4>compilerarg</h4>
  361. <p>You can specify additional command line arguments for the compiler
  362. with nested <code>&lt;compilerarg&gt;</code> elements. These elements
  363. are specified like <a href="../using.html#arg">Command-line
  364. Arguments</a> but have an additional attribute that can be used to
  365. enable arguments only if a given compiler implementation will be
  366. used.</p>
  367. <table border="1" cellpadding="2" cellspacing="0">
  368. <tr>
  369. <td width="12%" valign="top"><b>Attribute</b></td>
  370. <td width="78%" valign="top"><b>Description</b></td>
  371. <td width="10%" valign="top"><b>Required</b></td>
  372. </tr>
  373. <tr>
  374. <td valign="top">value</td>
  375. <td align="center" rowspan="4">See
  376. <a href="../using.html#arg">Command-line Arguments</a>.</td>
  377. <td align="center" rowspan="4">Exactly one of these.</td>
  378. </tr>
  379. <tr>
  380. <td valign="top">line</td>
  381. </tr>
  382. <tr>
  383. <td valign="top">file</td>
  384. </tr>
  385. <tr>
  386. <td valign="top">path</td>
  387. </tr>
  388. <tr>
  389. <td valign="top">compiler</td>
  390. <td>Only pass the specified argument if the chosen
  391. compiler implementation matches the value of this attribute.
  392. Legal values are the
  393. same as those in the above <a href="#compilervalues">list</a> of valid
  394. compilers.)</td>
  395. <td align="center">No</td>
  396. </tr>
  397. </table>
  398. <h3>Examples</h3>
  399. <pre> &lt;javac srcdir=&quot;${src}&quot;
  400. destdir=&quot;${build}&quot;
  401. classpath=&quot;xyz.jar&quot;
  402. debug=&quot;on&quot;
  403. /&gt;</pre>
  404. <p>compiles all <code>.java</code> files under the <code>${src}</code>
  405. directory, and stores
  406. the <code>.class</code> files in the <code>${build}</code> directory.
  407. The classpath used includes <code>xyz.jar</code>, and compiling with
  408. debug information is on.</p>
  409. <pre> &lt;javac srcdir=&quot;${src}&quot;
  410. destdir=&quot;${build}&quot;
  411. fork=&quot;true&quot;
  412. /&gt;</pre>
  413. <p>compiles all <code>.java</code> files under the <code>${src}</code>
  414. directory, and stores the <code>.class</code> files in the
  415. <code>${build}</code> directory. This will fork off the javac
  416. compiler using the default <code>javac</code> executable.</p>
  417. <pre> &lt;javac srcdir=&quot;${src}&quot;
  418. destdir=&quot;${build}&quot;
  419. fork=&quot;java$$javac.exe&quot;
  420. /&gt;</pre>
  421. <p>compiles all <code>.java</code> files under the <code>${src}</code>
  422. directory, and stores the <code>.class</code> files in the
  423. <code>${build}</code> directory. This will fork off the javac
  424. compiler, using the executable named <code>java$javac.exe</code>. Note
  425. that the <code>$</code> sign needs to be escaped by a second one.</p>
  426. <pre> &lt;javac srcdir=&quot;${src}&quot;
  427. destdir=&quot;${build}&quot;
  428. includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
  429. excludes=&quot;mypackage/p1/testpackage/**&quot;
  430. classpath=&quot;xyz.jar&quot;
  431. debug=&quot;on&quot;
  432. /&gt;</pre>
  433. <p>compiles <code>.java</code> files under the <code>${src}</code>
  434. directory, and stores the
  435. <code>.class</code> files in the <code>${build}</code> directory.
  436. The classpath used includes <code>xyz.jar</code>, and debug information is on.
  437. Only files under <code>mypackage/p1</code> and <code>mypackage/p2</code> are
  438. used. All files in and below the <code>mypackage/p1/testpackage</code>
  439. directory are excluded from compilation.</p>
  440. <pre> &lt;javac srcdir=&quot;${src}:${src2}&quot;
  441. destdir=&quot;${build}&quot;
  442. includes=&quot;mypackage/p1/**,mypackage/p2/**&quot;
  443. excludes=&quot;mypackage/p1/testpackage/**&quot;
  444. classpath=&quot;xyz.jar&quot;
  445. debug=&quot;on&quot;
  446. /&gt;</pre>
  447. <p>is the same as the previous example, with the addition of a second
  448. source path, defined by
  449. the property <code>src2</code>. This can also be represented using nested
  450. <code>&lt;src&gt;</code> elements as follows:</p>
  451. <pre> &lt;javac destdir=&quot;${build}&quot;
  452. classpath=&quot;xyz.jar&quot;
  453. debug=&quot;on&quot;&gt;
  454. &lt;src path=&quot;${src}&quot;/&gt;
  455. &lt;src path=&quot;${src2}&quot;/&gt;
  456. &lt;include name=&quot;mypackage/p1/**&quot;/&gt;
  457. &lt;include name=&quot;mypackage/p2/**&quot;/&gt;
  458. &lt;exclude name=&quot;mypackage/p1/testpackage/**&quot;/&gt;
  459. &lt;/javac&gt;</pre>
  460. <p>If you want to run the javac compiler of a different JDK, you
  461. should tell Ant, where to find the compiler and which version of JDK
  462. you will be using so it can choose the correct command line switches.
  463. The following example executes a JDK 1.1 javac in a new process and
  464. uses the correct command line switches even when Ant is running in a
  465. Java VM of a different version:</p>
  466. <pre> &lt;javac srcdir=&quot;${src}&quot;
  467. destdir=&quot;${build}&quot;
  468. fork=&quot;yes&quot;
  469. executable=&quot;/opt/java/jdk1.1/bin/javac&quot;
  470. compiler=&quot;javac1.1&quot;
  471. /&gt;</pre>
  472. <p><a name="srcdirnote"><b>Note:</b></a>
  473. If you wish to compile only source files located in certain packages below a
  474. common root, use the <code>include</code>/<code>exclude</code> attributes
  475. or <code>&lt;include&gt;</code>/<code>&lt;exclude&gt;</code> nested elements
  476. to filter for these packages. Do not include part of your package structure
  477. in the <code>srcdir</code> attribute
  478. (or nested <code>&lt;src&gt;</code> elements), or Ant will recompile your
  479. source files every time you run your compile target. See the
  480. <a href="http://ant.apache.org/faq.html#always-recompiles">Ant FAQ</a>
  481. for additional information.</p>
  482. <p><b>Note:</b> If you are using Ant on Windows and a new DOS window pops up
  483. for every use of an external compiler, this may be a problem of the JDK you are
  484. using. This problem may occur with all JDKs &lt; 1.2.</p>
  485. <h3>Jikes Notes</h3>
  486. <p>Jikes supports some extra options, which can be set be defining
  487. the properties shown below prior to invoking the task. The setting
  488. for each property will be in affect for all <code>&lt;javac&gt;</code>
  489. tasks throughout the build.
  490. The Ant developers are aware that
  491. this is ugly and inflexible &ndash; expect a better solution in the future.
  492. All the options are boolean, and must be set to <code>true</code> or
  493. <code>yes</code> to be
  494. interpreted as anything other than false. By default,
  495. <code>build.compiler.warnings</code> is <code>true</code>,
  496. while all others are <code>false</code>.</p>
  497. <table border="1" cellpadding="2" cellspacing="0">
  498. <tr>
  499. <td valign="top"><b>Property</b></td>
  500. <td valign="top"><b>Description</b></td>
  501. <td align="center" valign="top"><b>Default</b></td>
  502. </tr>
  503. <tr>
  504. <td valign="top">
  505. build.compiler.emacs
  506. </td>
  507. <td valign="top">
  508. Enable emacs-compatible error messages.
  509. </td>
  510. <td valign="top">
  511. <code>false</code>
  512. </td>
  513. </tr>
  514. <tr>
  515. <td valign="top">
  516. build.compiler.fulldepend
  517. </td>
  518. <td valign="top">
  519. Enable full dependency checking; see<br>
  520. the <code>+F</code> switch in the Jikes manual.
  521. </td>
  522. <td valign="top">
  523. <code>false</code>
  524. </td>
  525. </tr>
  526. <tr>
  527. <td valign="top">
  528. build.compiler.pedantic
  529. </td>
  530. <td valign="top">
  531. Enable pedantic warnings.
  532. </td>
  533. <td valign="top">
  534. <code>false</code>
  535. </td>
  536. </tr>
  537. <tr>
  538. <td valign="top">
  539. build.compiler.warnings<br>
  540. <strong>Deprecated</strong>. Use
  541. <code>&lt;javac&gt;</code>'s <code>nowarn</code>
  542. attribute instead.
  543. </td>
  544. <td valign="top">
  545. Don't disable warning messages.
  546. </td>
  547. <td valign="top">
  548. <code>true</code>
  549. </td>
  550. </tr>
  551. </table>
  552. <h3>Jvc Notes</h3>
  553. <p>Jvc will enable Microsoft extensions unless you set the property
  554. <code>build.compiler.jvc.extensions</code> to false before invoking
  555. <code>&lt;javac&gt;</code>.</p>
  556. <hr>
  557. <p align="center">Copyright &copy; 2000-2003 Apache Software Foundation.
  558. All rights Reserved.</p>
  559. </body>
  560. </html>