Open yzhangyext opened 1 week ago
This looks like https://github.com/bazelbuild/bazel/discussions/21769 and will possibly be fixed by https://github.com/bazelbuild/rules_java/pull/182. Could you try building by overriding rules_java to the state of that PR?
Hi team, we are planning to upgrade our bazel Java version to 21 in two steps, upgrading runtime first, followed by the toolchain compiler upgrade. I am now stuck at making the configuration work for Java 21 runtime while keeping the toolchain version as 17, Our current setting with Java 17 in Bazel is, set these flags in .bazelrc
Then register a toolchain with "default_java_toolchain"
My first attempt was to bump these two flags as
However I was seeing some build errors like
Then I go ahead and also change the java_runtime field within default_java_toolchain:
That makes the build pass, however I noticed the java compiler was actually 21 as well, while I expected it to stay 17, because I added some code related to VirtualThread and they were compiled successfully.
Did I make any mistakes in my configurations? Appreciate any pointers and tips.