Use latest rules_java (5.1.0) when Bzlmod is enabled
Use latest rules_java (5.1.0) when Bzlmod is enabled

Fixes https://github.com/bazelbuild/bazel/issues/16109

PiperOrigin-RevId: 468676158
Change-Id: I3db2b9a6d8d952fd0bb6bbfa0abc7936916bfe9b

cushon/bazel,katre/bazel,cushon/bazel,cushon/bazel,bazelbuild/bazel,bazelbuild/bazel,cushon/bazel,bazelbuild/bazel,katre/bazel,katre/bazel,katre/bazel,cushon/bazel,bazelbuild/bazel,katre/bazel,katre/bazel,bazelbuild/bazel,bazelbuild/bazel,cushon/bazel