Fix `@rules_java` CI after https://github.com/bazelbuild/bazel/commit/3b812d349882f0a12028f16379b83de757796737

Replace the now forbidden `/` with `_` as the separator in `platform` target names.

(ignore-relnotes)

PiperOrigin-RevId: 972431951
Change-Id: Id97e6ad920da8751a3f7cedcc1d691abf4a94999
diff --git a/test/java/bazel/rules/java_binary_tests.bzl b/test/java/bazel/rules/java_binary_tests.bzl
index 107f63f..a36a911 100644
--- a/test/java/bazel/rules/java_binary_tests.bzl
+++ b/test/java/bazel/rules/java_binary_tests.bzl
@@ -16,7 +16,7 @@
     # - is not supported by the default C++ toolchain
     util.helper_target(
         native.platform,
-        name = name + "/platform",
+        name = name + "_platform",
         constraint_values = [
             "@platforms//os:linux",
             "@platforms//cpu:s390x",
@@ -35,7 +35,7 @@
         impl = _test_java_binary_cross_compilation_to_unix_impl,
         target = name + "/bin",
         config_settings = {
-            "//command_line_option:platforms": [Label(name + "/platform")],
+            "//command_line_option:platforms": [Label(name + "_platform")],
         },
         # Requires the launcher_maker toolchain.
         attr_values = {"tags": ["min_bazel_9"]},
diff --git a/test/java/common/rules/java_test_tests.bzl b/test/java/common/rules/java_test_tests.bzl
index 1468fcc..4109d2a 100644
--- a/test/java/common/rules/java_test_tests.bzl
+++ b/test/java/common/rules/java_test_tests.bzl
@@ -212,7 +212,7 @@
 def _test_mac_requires_darwin_for_execution(name):
     util.helper_target(
         rule = native.platform,
-        name = name + "/darwin_x86_64",
+        name = name + "_darwin_x86_64",
         constraint_values = [
             "@platforms//os:macos",
             "@platforms//cpu:x86_64",
@@ -244,7 +244,7 @@
         name = name,
         target = name + "/test",
         config_settings = {
-            "//command_line_option:platforms": [Label(name + "/darwin_x86_64")],
+            "//command_line_option:platforms": [Label(name + "_darwin_x86_64")],
             "//command_line_option:extra_toolchains": toolchains,
         },
         impl = _test_mac_requires_darwin_for_execution_impl,