Based on the doc: /docs/bazel-and-java
To configure the JVM used for execution and testing use --java_runtime_version flag. The default value is local_jdk.
There is a second pair of JDK and JVM used to build and execute tools, which are used in the build process, but are not in the build results. That JDK and JVM are controlled using --tool_java_language_version and --tool_java_runtime_version. Default values are 11 and remotejdk_11, respectively.
Bazel uses two types of Java toolchains: - execution, used to execute and test Java binaries, controlled with --java_runtime_version flag - compilation, used to compile Java sources, controlled with --java_language_version flag
My understanding is that there are two JDK/JVM used each with two types of toolchains:
- Execution & testing (
--java_runtime_version
& `--java_language_version) - Build and execute tools (
--tool_java_runtime_version
& `--tool_java_language_version)
I'm confused about several points:
- What refers to tools? I'm not too familiar with Java ecosystem
- If I specify
remotejdk_17
for all 4 flags, does it ever use the host machine's jdk?