Skip to content

"gradlew buildBwcVersion" fails with misleading error if JAVA11_HOME is not set #37586

@hmcc

Description

@hmcc

Elasticsearch version (bin/elasticsearch --version): build issue, seen with master branch

Plugins installed: []

JVM version (java -version):

openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-2ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-2ubuntu1, mixed mode, sharing)

OS version (uname -a if on a Unix-like system):

Linux <name> 4.18.0-13-generic #14-Ubuntu SMP Wed Dec 5 09:04:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

When I run buildBwcVersion, it fails with ERROR: JAVA_HOME is set to an invalid directory: null, but JAVA_HOME is set. It's actually JAVA11_HOME that's missing.

Steps to reproduce:

  1. Confirm that JAVA_HOME is set, but JAVA11_HOME is not (env | grep JAVA)
  2. Check out the latest source and confirm that Java 11 is set in java-versions.properties (grep 11 .ci/java-versions.properties)
  3. Run ./gradlew buildBwcVersion. The build should fail with ERROR: JAVA_HOME is set to an invalid directory: null.

Provide logs (if relevant):

> Task :distribution:bwc:bugfix:buildBwcVersion FAILED

 [6.5.5] ERROR: JAVA_HOME is set to an invalid directory: null
 [6.5.5] 
 [6.5.5] Please set the JAVA_HOME variable in your environment to match the
 [6.5.5] location of your Java installation.
 [6.5.5] 

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':distribution:bwc:bugfix:buildBwcVersion'.
> Process 'command '/home/heather/code/git/elasticsearch/distribution/bwc/bugfix/build/bwc/checkout-6.5/gradlew'' finished with non-zero exit value 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Delivery/BuildBuild or test infrastructureTeam:DeliveryMeta label for Delivery team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions