Troubleshoot slow compilation

前端 未结 3 1046
野性不改
野性不改 2020-12-15 05:36

What should I do to investigate and troubleshoot a slow compilation problem?

My project has about 100 classes and takes more than 45 seconds to compi

3条回答
  •  长情又很酷
    2020-12-15 06:01

    One not so well known feature of Java 8 is Generalized Target-Type Inference.

    While it allows to write clearer code, this requires more work for Javac. Sometimes this results in exponential complexity of the type inference problem. This is a known issue, but unfortunately still unresolved - see JDK-8055984, JDK-8067767.

    The workaround is to compile at Java 7-compatibility level: javac -source 7, or just to use simpler constructions.

提交回复
热议问题