Can standard Sun javac do incremental compiling?

前端 未结 4 708
小鲜肉
小鲜肉 2020-12-14 01:01

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 comp

4条回答
  •  再見小時候
    2020-12-14 01:53

    Eclipse certainly does this. Also it does it at save time if you have that option turned on (and it is by default). It looks like sun also doesn't do this (it is very easy to test, just make a small project where A is the main class that uses class B, but B doesn't use class A. Then change A and compile the project again, see if the timestamp for b.class has changed.

    This is the way many compilers work (also gcc for instance). You can use tools like ant and make to compile only the part the project that has changed. Also note that these tools aren't perfect, sometimes eclipse just loses track of the changes and you'll need to do a full rebuild.

提交回复
热议问题