Update Java rules to use the toolchain transition.

This is phase 2 of of the switch to toolchain transitions. See https://github.com/bazelbuild/bazel/issues/11584 for details.

Downstream Bazel tests: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1692

PiperOrigin-RevId: 338302806
diff --git a/tools/jdk/java_toolchain_alias.bzl b/tools/jdk/java_toolchain_alias.bzl
index 4069d71..4647666 100644
--- a/tools/jdk/java_toolchain_alias.bzl
+++ b/tools/jdk/java_toolchain_alias.bzl
@@ -92,6 +92,7 @@
             default = Label("@bazel_tools//tools/jdk:legacy_current_java_toolchain"),
         ),
     },
+    incompatible_use_toolchain_transition = True,
 )
 
 # Add aliases for the legacy native rules to allow referring to both versions in @bazel_tools//tools/jdk