Java Compiler - Eclipse Compiler


#1

Hi,

as sbt can compile java files ( https://www.scala-sbt.org/1.0/docs/Java-Sources.html ) is it possible to replace the used compiler? Eg. javac with the eclipse compiler (jdt).

thanks
marc


#2

Not unless jdt supports the same public compiler API as Javac. What is your use case?


#3

hi jvican,

I read that jdt supports multicore cpus and is faster.

best regards
marc


#4

If you’re interested in implementing this, you could try to implement your own https://github.com/sbt/zinc/blob/1.x/internal/compiler-interface/src/main/java/xsbti/compile/JavaTool.java in Zinc (Scala and Java’s incremental compiler). You would most likely need to read the contributing guide, depend on JDT and see if you can fit it in the Java Tool and JavaCompiler interfaces.


#5

Hi jvican,

thanks for your answer, perhaps I´ll have a look at this.

I made some performance tests the last days evaluationg the threadripper cpu and saw that the “sbt” tool needs a very long time to finish after the last “done compiling” message is written to the console. do you perhaps know whats done after this message pops up and before the sbt tool exits? in windows taskmanager I can see that only one cpu/thread is active then and is using “100% cpu”.until sbt ends.

on an older intel cpu this last step is twice as fast and there is no 100% usage on only one cpu/thread.

thanks
marc