Skip to content

Commit 5b31909

Browse files
authored
Use tool instead of compilation runtime in jvm_import actions (#1059)
PR #1058 made the `jvm_import` actions use Java toolchains rather than host tools, but chose the runtime used to run `javac` instead of the runtime used to run build tools. The latter can be configured via `--tool_java_runtime_version` while the former is fixed in the Java compilation toolchain.
1 parent 5a78bc6 commit 5b31909

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

private/rules/jvm_import.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _jvm_import_impl(ctx):
2323
workspace_name = visible_name,
2424
)
2525

26-
java_runtime = ctx.toolchains["@bazel_tools//tools/jdk:toolchain_type"].java.java_runtime
26+
java_runtime = ctx.toolchains["@bazel_tools//tools/jdk:runtime_toolchain_type"].java_runtime
2727
add_jar_manifest_entry_jar = ctx.file._add_jar_manifest_entry
2828

2929
injar = ctx.files.jars[0]
@@ -118,5 +118,5 @@ jvm_import = rule(
118118
},
119119
implementation = _jvm_import_impl,
120120
provides = [JavaInfo],
121-
toolchains = ["@bazel_tools//tools/jdk:toolchain_type"],
121+
toolchains = ["@bazel_tools//tools/jdk:runtime_toolchain_type"],
122122
)

0 commit comments

Comments
 (0)