rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

java_compile_toolchain is not used for Scala compilation

Open eed3si9n opened this issue 3 years ago • 0 comments
trafficstars

steps

  1. globally set the java_runtime to JDK 8.
  2. set a target level java_compile_toolchain to JDK 11.

problem

@Duhemm found that in that situation Java source can use JDK 11 but Scala source cannot. For example:

package java11

object ScalaSource {
  val hello = "hello".repeat(2)
}

expectations

Both Scala and Java can use JDK 11.

notes

_scalac is a program that points to @io_bazel_rules_scala//src/java/io/bazel/rulesscala/scalac, which is a java_binary target. The generated shell script assigns JAVABIN to the current Java runtime if JAVABIN environment variable is not set.

eed3si9n avatar Nov 01 '22 23:11 eed3si9n