Skip to content

Commit 899c2b7

Browse files
fmeumrules_java Copybara
authored andcommitted
Improve the error message for no matching bootclasspath (#296)
Closes #296 COPYBARA_INTEGRATE_REVIEW=#296 from fmeum:patch-3 6579d51 PiperOrigin-RevId: 763898415 Change-Id: I3a4a07d682e1e1b450b433931f3366bbe3051e3a
1 parent 0af04ab commit 899c2b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

toolchains/bootclasspath.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,12 @@ def _bootclasspath_impl(ctx):
165165
tool_prefix = "tool_" if is_exec else ""
166166
fail("""
167167
No Java runtime found to extract the bootclasspath from for --{tool_prefix}java_language_version={language_version} and --{tool_prefix}java_runtime_version={runtime_version}.
168-
You can:
168+
The bootclasspath provides the particular version of the Java standard library to compile against.
169+
You can do one of the following:
169170
170-
* register a Java runtime with name "{bootstrap_runtime_version}" to provide the bootclasspath or
171-
* set --java_language_version to the Java version of an available runtime.
171+
* register a Java runtime with name "{bootstrap_runtime_version}" to provide the bootclasspath
172+
* set --java_language_version=N for an available runtime "{runtime_version}_N"
173+
* remove the suffix from your runtime's name to use it as the bootclasspath
172174
173175
Rerun with --toolchain_resolution_debug='@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type' to see more details about toolchain resolution.
174176
""".format(

0 commit comments

Comments
 (0)