Distributed Java Compiler

前端 未结 5 949
[愿得一人]
[愿得一人] 2021-02-07 06:52

Is there a distributed compiler for Java, analogous to distcc for C/C++?

5条回答
  •  星月不相逢
    2021-02-07 07:32

    The direct answer to your question is "no". However, it probably would not help you anyway… compiling Java is very fast.

    On a small project, the compilation is fast enough that you shouldn't really care. On a large project you would need to deal with throwing the file to compile over a network, and having to deal with potentially also throw across many megabytes of dependencies as well.

    One thing that you can do to improve your compilation speed is to use the eclipse compiler instead of the Sun javac. The Eclipse compiler is multi-threaded, and so will, with luck, use all the cores of your machine.

    It is probably also worth mentioning that Apple also recently reduced distcc support, since in general, on newer hardware, it cost more time to get the code somewhere else to compile and back, than it did to just do the compilation locally. To quote Apple:

    The single-computer build performance of Xcode has been improved to the point that distributed building with Distributed Network Builds is slower than local builds in most circumstances.

提交回复
热议问题