Use selects based on constraint_values in java_tools.
Use selects based on constraint_values in java_tools.

This makes them consistent with platformization which works on OS and CPU constraints from @platforms.

Flag --cpu=darwin maps on Bazel to macos+x86_64, internally --cpu=darwin_x86_64 is used. With platforms, those become a single config_setting.

I didn't combine together other darwin config_settings (dropping cpu), because of possible combination macos+ppc.

Closes #12410.

PiperOrigin-RevId: 340636557

meteorcloudy/bazel,katre/bazel,safarmer/bazel,cushon/bazel,katre/bazel,twitter-forks/bazel,twitter-forks/bazel,meteorcloudy/bazel,perezd/bazel,meteorcloudy/bazel,cushon/bazel,katre/bazel,safarmer/bazel,katre/bazel,perezd/bazel,perezd/bazel,safarmer/bazel,katre/bazel,twitter-forks/bazel,ButterflyNetwork/bazel,safarmer/bazel,ButterflyNetwork/bazel,twitter-forks/bazel,perezd/bazel,twitter-forks/bazel,bazelbuild/bazel,meteorcloudy/bazel,twitter-forks/bazel,perezd/bazel,perezd/bazel,cushon/bazel,meteorcloudy/bazel,ButterflyNetwork/bazel,ButterflyNetwork/bazel,bazelbuild/bazel,safarmer/bazel,ButterflyNetwork/bazel,twitter-forks/bazel,safarmer/bazel,meteorcloudy/bazel,katre/bazel,bazelbuild/bazel,cushon/bazel,cushon/bazel,ButterflyNetwork/bazel,meteorcloudy/bazel,perezd/bazel,bazelbuild/bazel,bazelbuild/bazel,cushon/bazel,bazelbuild/bazel