Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not use with Java versions newer than 13 #711

Closed
andrewhamon opened this issue Apr 7, 2022 · 0 comments · Fixed by #712
Closed

Can not use with Java versions newer than 13 #711

andrewhamon opened this issue Apr 7, 2022 · 0 comments · Fixed by #712

Comments

@andrewhamon
Copy link
Contributor

I am experimenting with upgrading a mixed-jvm codebase to java 17.

I started by setting --java_language_version=17 and --java_runtime_version=17 in our .bazelrc.

Our Kotlin targets that depend on java targets started failing to coming with

bad_class_file: path/to/some/File.class
  class file has wrong version 61.0, should be 55.0
  Please remove or make sure it appears in the correct subdirectory of the classpath.

We are using a custom Kotlin toolchain, so I tried to set jvm_target = "17". However, the rule impl prevents this:

BUILD:89:20: //:kotlin_toolchain_impl: invalid value in 'jvm_target' attribute: has to be one of '1.6', '1.8', '9', '10', '11', '12' or '13' instead of '17'

Indeed, kotlin_toolchain_impl has an allowlist for options that only goes up to 13:

"jvm_target": attr.string(
doc = "the -jvm_target flag. This is only tested at 1.8.",
default = "1.8",
values = [
"1.6",
"1.8",
"9",
"10",
"11",
"12",
"13",
],
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant