<bdo id='0hHs1'></bdo><ul id='0hHs1'></ul>
    1. <tfoot id='0hHs1'></tfoot>

        <legend id='0hHs1'><style id='0hHs1'><dir id='0hHs1'><q id='0hHs1'></q></dir></style></legend>

        <small id='0hHs1'></small><noframes id='0hHs1'>

        <i id='0hHs1'><tr id='0hHs1'><dt id='0hHs1'><q id='0hHs1'><span id='0hHs1'><b id='0hHs1'><form id='0hHs1'><ins id='0hHs1'></ins><ul id='0hHs1'></ul><sub id='0hHs1'></sub></form><legend id='0hHs1'></legend><bdo id='0hHs1'><pre id='0hHs1'><center id='0hHs1'></center></pre></bdo></b><th id='0hHs1'></th></span></q></dt></tr></i><div id='0hHs1'><tfoot id='0hHs1'></tfoot><dl id='0hHs1'><fieldset id='0hHs1'></fieldset></dl></div>
      1. 标准的 Sun javac 可以进行增量编译吗?

        时间:2023-10-14
          • <tfoot id='8Ln9B'></tfoot>

              <i id='8Ln9B'><tr id='8Ln9B'><dt id='8Ln9B'><q id='8Ln9B'><span id='8Ln9B'><b id='8Ln9B'><form id='8Ln9B'><ins id='8Ln9B'></ins><ul id='8Ln9B'></ul><sub id='8Ln9B'></sub></form><legend id='8Ln9B'></legend><bdo id='8Ln9B'><pre id='8Ln9B'><center id='8Ln9B'></center></pre></bdo></b><th id='8Ln9B'></th></span></q></dt></tr></i><div id='8Ln9B'><tfoot id='8Ln9B'></tfoot><dl id='8Ln9B'><fieldset id='8Ln9B'></fieldset></dl></div>

            1. <small id='8Ln9B'></small><noframes id='8Ln9B'>

                <tbody id='8Ln9B'></tbody>

            2. <legend id='8Ln9B'><style id='8Ln9B'><dir id='8Ln9B'><q id='8Ln9B'></q></dir></style></legend>

                  <bdo id='8Ln9B'></bdo><ul id='8Ln9B'></ul>
                • 本文介绍了标准的 Sun javac 可以进行增量编译吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  最近我开始使用 Eclipse 的 java 编译器,因为它比标准的 javac 快得多.有人告诉我它更快,因为它执行增量编译.但我仍然对此有点不确定,因为我找不到任何关于这两者的权威文档 - eclispse 和 sun 的 - 编译器增量功能".是不是 Sun 的编译器总是编译每个源文件,而 Eclipse 的编译器只编译已更改的文件以及受此类更改影响的文件?

                  Recently I started to use Eclipse's java compiler, because it is significantly faster than standard javac. I was told that it's faster because it performs incremental compiling. But I'm still a bit unsure about this since I can't find any authoritative documentation about both - eclispse's and sun's - compilers "incremental feature". Is it true that Sun's compiler always compiles every source file and Eclipse's compiler compile only changed files and those that are affected by such a change?

                  我没有使用 Eclipse 自动构建功能,而是在设置

                  I'm not using Eclipse autobuild feature but instead I'm setting

                  -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
                  

                  对于我的 ant 构建.

                  for my ant builds.

                  推荐答案

                  Sun 的编译器是否总是编译每个源文件而 Eclipse 的编译器只编译已更改的文件以及受此类更改影响的文件?

                  Is it true that Sun's compiler always compiles every source file and Eclipse's compiler compile only changed files and those that are affected by such a change?

                  我相信你在这两个方面都是正确的.

                  I believe that you are correct on both counts.

                  您当然可以强制 Eclipse 重新编译所有内容.

                  You can of course force Eclipse to recompile everything.

                  但等式的另一部分是,Ant 和 Maven 等 Java 构建工具只能编译已更改的类及其依赖类树.

                  But the other part of the equation is that Java build tools like Ant and Maven are capable of only compiling classes that have changed, and their tree of dependent classes.

                  编辑

                  在 Ant 中,增量编译可以通过两种方式完成:

                  In Ant, incremental compilation can be done in two ways:

                  • 默认情况下 <javac>task 比较 .java 和对应的 .class 文件的时间戳,并且只告诉 Java 编译器重新编译比它们更新的源 (.java) 文件对应的目标(.class)文件,或者根本没有目标文件.

                  • By default the <javac> task compares the timestamps of .java and corresponding .class files, and only tells the Java compiler to recompile source (.java) files that are newer than their corresponding target (.class) files, or that don't have a target file at all.

                  <depend> 任务 还考虑了类之间的依赖关系,它通过读取和分析嵌入在 .class 文件中的依赖关系信息来确定.在确定了哪些 .class 文件已过期后,<depend> 任务将它们删除,因此后面的 <javac> 任务将重新编译他们.然而,这并不完全是万无一失的.例如,对源代码的大量更改可能导致 <depend> 任务可能正在分析陈旧的依赖关系.在 .class 文件格式中,某些类型的依赖关系(例如静态常量)也不明显.

                  The <depend> task also takes into account dependencies between classes, which it determines by reading and analysing the dependency information embedded in the .class files. Having determined which .class files are out of date, the <depend> task deletes them so a following <javac> task will recompile them. However, this is not entirely fool-proof. For example, extensive changes to the source code can lead to the <depend> task may be analysing stale dependencies. Also certain kinds of dependency (e.g. on static constants) are not apparent in the .class file format.

                  要了解为什么 Ant <depend> 不是万无一失的,请阅读 文档.

                  To understand why Ant <depend> is not fool-proof, read the "Limitations" section of the documentation.

                  这篇关于标准的 Sun javac 可以进行增量编译吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:java什么时候比c++快(或者JIT什么时候比预编译快)? 下一篇:Java for 循环性能问题

                  相关文章

                    <small id='TrWR3'></small><noframes id='TrWR3'>

                  1. <i id='TrWR3'><tr id='TrWR3'><dt id='TrWR3'><q id='TrWR3'><span id='TrWR3'><b id='TrWR3'><form id='TrWR3'><ins id='TrWR3'></ins><ul id='TrWR3'></ul><sub id='TrWR3'></sub></form><legend id='TrWR3'></legend><bdo id='TrWR3'><pre id='TrWR3'><center id='TrWR3'></center></pre></bdo></b><th id='TrWR3'></th></span></q></dt></tr></i><div id='TrWR3'><tfoot id='TrWR3'></tfoot><dl id='TrWR3'><fieldset id='TrWR3'></fieldset></dl></div>
                      <tfoot id='TrWR3'></tfoot>
                      • <bdo id='TrWR3'></bdo><ul id='TrWR3'></ul>
                      <legend id='TrWR3'><style id='TrWR3'><dir id='TrWR3'><q id='TrWR3'></q></dir></style></legend>