rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

How to set JVM version? rules_scala keeps insisting on using Java 11

Open grepwood opened this issue 1 year ago • 1 comments
trafficstars

I would like to use Java 17 but it keeps trying to use Java 11. How can I force rules_scala to stop trying to get older Java? I tried the following options:

--host_javabase=@bazel_tools//tools/jdk:toolchain:java17
--javabase=@bazel_tools//tools/jdk:toolchain:java17
--host_java_toolchain=@bazel_tools//tools/jdk:toolchain:java17
--java_toolchain=@bazel_tools//tools/jdk:toolchain:java17

and none of them work in the end. I'm on Bazel 6.5.0 btw.

grepwood avatar May 13 '24 12:05 grepwood

Try using --tool_java_runtime_version=remotejdk_17. That should be what the scala compiler is hosted on. For what gets used during run and test, use --java_runtime_version=remotejdk_17.

(I think host_javabase and java_toolchain are both deprecated at this point).

crt-31 avatar May 16 '24 02:05 crt-31