Hi Ittai,
not a dumb question at all.
We've been testing Bazel with Azul's
Zulu (certified and pretty much vanilla) OpenJDK build and Oracle's JDK for some time and couldn't observe any difference.
Inside Google we're also using a custom version of OpenJDK to run Bazel and our other Java software.
With the change to Buildkite, I also switched our CI workers to use Azul Zulu as their local JDK, so Oracle JDK is no longer being automatically tested - although I wouldn't expect any issues using that. This was an invisible change - again we couldn't observe any difference in performance or behavior.
Other companies also tend to bundle a custom patched version of OpenJDK with their Java software, e.g. JetBrains has their own version of OpenJDK with relevant fixes that is included with IntelliJ and their other software:
https://github.com/JetBrains/jdk8uAlso, Bazel includes two escape hatches :) You can tell Bazel to completely ignore the bundled JDK and use any local JDK to run itself and all of its tools:
philwo@philwo-macbookpro ~/src/bazel (master *) bazel info
java-home: /private/var/tmp/_bazel_philwo/install/aaf45a69b50723670ecae3ec4e7a8395/_embedded_binaries/embedded_tools/jdk/jre
java-runtime: OpenJDK Runtime Environment (build 1.8.0_163-b01) by Azul Systems, Inc.
philwo@philwo-macbookpro ~/src/bazel (master *) bazel --host_javabase=$JAVA_HOME info
java-home: /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre
java-runtime: Java(TM) SE Runtime Environment (build 1.8.0_151-b12) by Oracle Corporation
You can also let Bazel use its bundled JDK to run itself, but then use a different JDK to run tools (e.g. JavaBuilder and Java binaries):
cat >> ~/myproject/BUILD <<'EOF'
java_runtime_suite(name="cmdline", default=":cmdline-jdk")
java_runtime(name="cmdline-jdk", java_home="$(CUSTOM_JDK)", visibility=["//visibility:public"])
EOF
bazel build --host_javabase=//:cmdline-jdk --javabase=//:cmdline-jdk --define=CUSTOM_JDK=$JAVA_HOME //src:bazel
Alternatively you can of course always check-in a JDK into your repository and use that with --(host_)javabase=, or hardcode the path to it in the java_home= attribute, instead of using a variable.
If it's too annoying to pass these flags, we could e.g. add an --ignore_bundled_jdk flag to the startup options and/or include the "cmdline" / "cmdline-jdk" lines in Bazel's embedded //tools BUILD files, so that you don't have to add them to your own project.
But: I think you shouldn't observe any difference or issues with the Bazel that bundles an OpenJDK. It should just work great out of the box. If you do notice something, I'd consider that a P1 bug - please let me know immediately!
Cheers,
Philipp