Skip to content

Cannot build Gerrit with JDK9 #5896

Closed
Closed

Description

@davido

On most recent Bazel master (7574d84) the most recent Gerrit master (b0e82956b1e8b4b04d187c26ec6e055beeaedb82) cannot be built any more (it worked already) with JDK9:

$ java --version
openjdk 9.0.4
OpenJDK Runtime Environment (build 9.0.4+12-suse-4.2-x8664)
OpenJDK 64-Bit Server VM (build 9.0.4+12-suse-4.2-x8664, mixed mode)
$ b9 build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java9 --java_toolchain=@bazel_tools//tools/jdk:toolchain_java9 :release
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_skylib/lib/versions.bzl:98:7: 
Current Bazel is not a release version, cannot check for compatibility.
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_skylib/lib/versions.bzl:99:7: Make sure that you are running at least Bazel 0.14.0.
INFO: Analysed target //:release (0 packages loaded).
INFO: Found 1 target...
ERROR: /home/davido/projects/gerrit/java/com/google/gerrit/launcher/BUILD:3:1: Building java/com/google/gerrit/launcher/liblauncher-class.jar (1 source file) failed (Exit 1)
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
Target //:release failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.064s, Critical Path: 0.16s
INFO: 5 processes: 4 remote cache hit, 1 linux-sandbox.
FAILED: Build did NOT complete successfully

Activity

  1. davido commented on Aug 15, 2018

    @davido
    ContributorAuthor
  2. cushon commented on Aug 15, 2018

    @cushon
    Contributor

    cc @buchgr

    The regression was from updating the embedded JDK to 10 in 4c9149d. The javac we use doesn't support --release when running on JDK 10 yet.

    Setting --server_javabase= to JDK 9 works around the problem.

    The fix is to update to the JDK 10 javac, but we can't do that until we're ready to drop support for JDK 8 --host_javabases in the default toolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions