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.