Remove header_compiler_direct_opts from java_toolchain (#379)

java_tools v21.0 bundles protobuf 36.0, whose Java runtime no longer uses sun.misc.Unsafe for standard generated code. That removes the JDK 24+ warning that motivated header_compiler_direct_opts as a TurbineDirect workaround.

Drop the attribute before it becomes API surface. The direct header compiler no longer needs --sun-misc-unsafe-memory-access=allow for protobuf. A native turbine_direct_graal would also treat JVM flags passed through this attribute as Turbine command-line options.

Fixes #374

RELNOTES: None

Closes #379

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_java/pull/379 from davido:revert-header-compiler-direct-opts eec72e458f6804ed52a699a92f82a5d52aca0693
PiperOrigin-RevId: 970407219
Change-Id: I30b00796fd175de88d05477fe9cc67a3cce5a2c7
1 file changed
tree: 0e3602c366cb7434ab8597fedde2658e4138da9d
  1. .bazel_checkout/
  2. .bazelci/
  3. .bcr/
  4. .github/
  5. distro/
  6. examples/
  7. java/
  8. test/
  9. third_party/
  10. toolchains/
  11. .bazelignore
  12. .bazelrc
  13. .gitignore
  14. AUTHORS
  15. BUILD
  16. CODEOWNERS
  17. CONTRIBUTING.md
  18. LICENSE
  19. MODULE.bazel
  20. README.md
  21. renovate.json
  22. WORKSPACE
  23. WORKSPACE.bzlmod
README.md

rules_java

Build status

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

Documentation

For a quickstart tutorial, see https://bazel.build/start/java

The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/java.

For slightly more advanced usage, like setting up toolchains or writing your own java-like rules, see https://bazel.build/docs/bazel-and-java

Core Java rules

Add a load like:

load("@rules_java//java:java_library.bzl", "java_library")

to your BUILD / BUILD.bazel / *.bzl files

For detailed docs on the core rules, see https://bazel.build/reference/be/java