Using multiple cores/processors when compiling Java

前端 未结 6 633
梦如初夏
梦如初夏 2020-12-13 19:30

I use a desktop with eight cores to build a Java application using Ant (through a javac target). Is there a way to speed up the compilation by using more than one thread or

6条回答
  •  甜味超标
    2020-12-13 19:46

    The documentation seems to indicate that it's unlikely to work correctly with javac.

    Anyone trying to run large Ant task sequences in parallel, such as javadoc and javac at the same time, is implicitly taking on the task of identifying and fixing all concurrency bugs the tasks that they run.

    Accordingly, while this task has uses, it should be considered an advanced task which should be used in certain batch-processing or testing situations, rather than an easy trick to speed up build times on a multiway CPU.

提交回复
热议问题