Bazel is downloading and using an old Java 11.0.1. There have been five releases of Java 11 with security updates since then.
I can make Bazel use my local JDK but this has obvious drawbacks.
How can I build using a safe up-to-date version of JDK?
I am not at all convinced that this is necessary. (See my comments on the question.)
However if you really wanted to change Bazel's built-in Java you could take one of these approaches:
There is a --javabse
option in Bazel 2.0.0 (and also some other Bazel versions):
--javabase (label) This option sets the label of the base Java installation to use for bazel run, bazel test, and for Java binaries built by java_binary and java_test rules.
Just add a .bazelrc
file alongside to your WORKSPACE
file:
.bazelrc
build --javabase=//my_tools/my_own_jdk
Take also a look onto java_runtime()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.