diff --git a/src/main/starlark/builtins_bzl/common/java/java_common_internal_for_builtins.bzl b/src/main/starlark/builtins_bzl/common/java/java_common_internal_for_builtins.bzl index 1079e44c5672c5..213bafe8749958 100644 --- a/src/main/starlark/builtins_bzl/common/java/java_common_internal_for_builtins.bzl +++ b/src/main/starlark/builtins_bzl/common/java/java_common_internal_for_builtins.bzl @@ -335,15 +335,13 @@ def _should_use_header_compilation(ctx, toolchain): if not toolchain.has_header_compiler(): fail( "header compilation was requested but it is not supported by the " + - "current Java toolchain '" + - "//" + str(toolchain.label.package) + ":" + toolchain.label.name + + "current Java toolchain '" + str(toolchain.label) + "'; see the java_toolchain.header_compiler attribute", ) if not toolchain.has_header_compiler_direct(): fail( "header compilation was requested but it is not supported by the " + - "current Java toolchain '" + - "//" + str(toolchain.label.package) + ":" + toolchain.label.name + + "current Java toolchain '" + str(toolchain.label) + "'; see the java_toolchain.header_compiler_direct attribute", ) return True