Distributed Java Compiler

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

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

5条回答
  •  天命终不由人
    2021-02-07 07:23

    If you're annoyed with waiting a long time for your java compiles, then you might consider one of the following:

    • break your project up into several different jar files (in a hierarchic dependency). With any luck, your changes will only affect source in one of those jars, while the others can continue to serve as dependencies.
    • break your project into groups of sources, perhaps by package, and use Apache ant to coordinate your compiling. I was always too lazy to use it, but you can set up explicit dependency management to avoid re-compiling stuff for which .class files already exist and are newer than the source. The effort that goes into setting this up once can reap dividends within a few days if the project is large and compiles are chewing up a lot of your time.

    As opposed to multi-coring, reducing the amount of code that you need to recompile will also reduce your PC's energy consumption and carbon footprint ;)

提交回复
热议问题