You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a bazel project (currently on Bazel 6.4.0) using rules_scala where we need to produce jars on java language version 8, but we'd like to move up the Java version used for tooling.
Builds are successful but tests fail with the following:
Exception in thread "main" java.lang.UnsupportedClassVersionError: io/bazel/rulesscala/scala_test/Runner has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
So it looks like the scala_test Runner is compiled based on tool_java_language_version and then used when running tests.
Is it expected that rules_scala requires tool_java_language_version less than or equal to java_language_version? Are there potential workarounds?
For reference, my current interest is to bring the tool jdk up to a level where coverage tools can run as discussed in bazelbuild/bazel#17606.
The text was updated successfully, but these errors were encountered:
jklukas
changed the title
Unable to advance --tool_java_runtime_version due to scala_test Runner
Unable to advance --tool_java_language_version due to scala_test Runner
Feb 14, 2025
So in this configuration, we're using JDK 17 when compiling the scalatest Runner, but it's compiling using language version 8, which ends up creating a jar that can still be consumed when running tests using JDK 8.
So, the question still stands: is it intended behavior that --tool_java_language_version cannot be higher than --java_language_version when using rules_scala?
I think, for example, this isn't an issue with Java rules because they're using precompiled jars.
I have a bazel project (currently on Bazel 6.4.0) using
rules_scala
where we need to produce jars on java language version 8, but we'd like to move up the Java version used for tooling.So currently in our
.bazelrc
we have:I tried bumping up the
tool
versions:Builds are successful but tests fail with the following:
So it looks like the scala_test
Runner
is compiled based ontool_java_language_version
and then used when running tests.Is it expected that
rules_scala
requirestool_java_language_version
less than or equal tojava_language_version
? Are there potential workarounds?For reference, my current interest is to bring the tool jdk up to a level where coverage tools can run as discussed in bazelbuild/bazel#17606.
The text was updated successfully, but these errors were encountered: