fix: downstream change from java bazel (#3518)

Prepare for changes to toolchain handling in java_common

This change is backwards compatible, after the next Bazel release
this code can be updated to use the approach described here:
https://github.com/bazelbuild/bazel/issues/7186
1 file changed