Expose correct symbols from Blaze

BEGIN_PUBLIC
Internal change
END_PUBLIC

PiperOrigin-RevId: 666314384
Change-Id: Id5c5ac6b9a729465a43ce2218c4ab6584940c966
diff --git a/java/private/proto_support.bzl b/java/private/proto_support.bzl
index 624f0d6..8dd644c 100644
--- a/java/private/proto_support.bzl
+++ b/java/private/proto_support.bzl
@@ -13,15 +13,9 @@
 # limitations under the License.
 """Support for Java compilation of protocol buffer generated code."""
 
-load("//java/private:native.bzl", "native_java_common")
+_legacy_api = _legacy_api_DO_NOT_USE_OR_ELSE()
 
 visibility(["//third_party/protobuf/..."])
 
-# Partial support, because internal symbols are not available in older Bazel version
-# TODO: Once Java rules are moved into the rules_java, this should become a full support.
-
-def compile(*, injecting_rule_kind, enable_jspecify, include_compilation_info, **kwargs):  # buildifier: disable=unused-variable
-    return native_java_common.compile(**kwargs)
-
-def merge(providers, *, merge_java_outputs = True, merge_source_jars = True):  # buildifier: disable=unused-variable
-    return native_java_common.merge(providers)
+compile = _legacy_api.java_compile_for_protos
+merge = _legacy_api.java_info_merge_for_protos