Use `target_compatible_with` for Java runtimes

The JDK is a runtime. Actions like `java_binary` output an executable that
contains a JDK in its runfiles, and that JDK needs to be compatible with the
target platform. (Actions like `genrule` that execute the JDK can depend
on the JDK as a `tool`, which does an explicit transition to the `exec`
platform.)

PiperOrigin-RevId: 426995073
Change-Id: I97ab530c56047b780b1a2170937ddf162660840b
2 files changed
tree: e4a0754db197cac3b49dc50e01dd635d0b27f7fa
  1. .bazelci/
  2. distro/
  3. examples/
  4. java/
  5. toolchains/
  6. .bazelrc
  7. .gitignore
  8. AUTHORS
  9. BUILD
  10. CODEOWNERS
  11. CONTRIBUTING.md
  12. internal_deps.bzl
  13. internal_setup.bzl
  14. LICENSE
  15. MODULE.bazel
  16. README.md
  17. renovate.json
  18. WORKSPACE
  19. WORKSPACE.bzlmod
README.md

rules_java

  • Postsubmit Build status
  • Postsubmit + Current Bazel Incompatible Flags Build status

Java Rules for Bazel https://bazel.build.