Which java version does bazel use?

1,184 views
Skip to first unread message

thomasmu...@yahoo.com

unread,
Apr 9, 2019, 1:23:53 PM4/9/19
to Repo and Gerrit Discussion
Hi, we are trying to investigate why this https://groups.google.com/forum/#!topic/repo-discuss/pBMh09-XJsw is more of a problem in 2.15.11/2.15.12.

Could this be related to this backport i did https://gerrit.wikimedia.org/r/#/c/operations/software/gerrit/+/493636/ in which case what java version does bazel use?

I found this:

/home/paladox/.cache/bazel/_bazel_paladox/8084ca779e4616ed6ae04d8ec477672b/external/remotejdk10_linux/bin/java --version

openjdk 10.0.1 2018-04-17

OpenJDK Runtime Environment Zulu10.2+3 (build 10.0.1+9)

OpenJDK 64-Bit Server VM Zulu10.2+3 (build 10.0.1+9, mixed mode)


and


/home/paladox/.cache/bazel/_bazel_paladox/8084ca779e4616ed6ae04d8ec477672b/external/remotejdk_linux/bin/java -version

openjdk version "9.0.7.1"

OpenJDK Runtime Environment (Zulu build 9.0.7.1+1)

OpenJDK 64-Bit Server VM (Zulu build 9.0.7.1+1, mixed mode)


So could this be java 8 vs java 9 issues?


I also found this doc https://docs.bazel.build/versions/master/tutorial/java.html#install-the-jdk , does that mean we should do it so that it builds gerrit 2.15.12 with java 8 instead of java 9?

Gert van Dijk

unread,
Apr 9, 2019, 4:46:58 PM4/9/19
to Repo and Gerrit Discussion
IIUC, Bazel always* uses a host JDK to build with and the JDK embedded into the Bazel binary is more like a JRE, which is used to run Bazel itself with. The JRE you see shows up as the "Zulu" one, embedded into Bazel, which is chosen for its tiny size, if I'm correct.

The tutorial you linked to shows that you need to install the JDK, because it's a Java project example being shown there.

* Here's an example where it did not obey this rule (thread), but that was a bug, and you may also find more pointers in there related to this topic: https://groups.google.com/d/msg/repo-discuss/d_qGIW0PnpU/9RRZ70XnEAAJ

HTH

thomasmu...@yahoo.com

unread,
Apr 10, 2019, 8:26:59 AM4/10/19
to Repo and Gerrit Discussion
Reply all
Reply to author
Forward
0 new messages