From 23ab9e020408caf89e250ca1b8b860224585e8ee Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 11 Dec 2019 16:02:31 -0500 Subject: [PATCH] Require JDK 13 for compilation (#50004) We have a long history of advancing the required compiler to the newest JDK. JDK 13 has been with us for awhile, but we were blocked from upgrading since Gradle was not compatible with JDK 13. With the advancement in our project to Gradle 6 which supports JDK 13, we can now advance our minimum compiler version. This commit updates the minimum compiler version to JDK 13. --- .ci/build.sh | 2 +- .ci/java-versions.properties | 2 +- .ci/matrix-build-javas.yml | 2 +- .ci/matrix-runtime-javas.yml | 3 --- .ci/packer_cache.sh | 3 ++- CONTRIBUTING.md | 8 ++++---- .../org/elasticsearch/gradle/test/DistroTestPlugin.java | 2 +- buildSrc/src/main/resources/minimumCompilerVersion | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 6dfc06a0912fb..b86acfd8cef1d 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -JAVA_HOME=${JAVA_HOME:-$HOME/.java/openjdk12} +JAVA_HOME=${JAVA_HOME:-$HOME/.java/openjdk13} RUNTIME_JAVA_HOME=${RUNTIME_JAVA_HOME:-$HOME/.java/openjdk11} JAVA7_HOME=$HOME/.java/java7 diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index db62e90950282..bb6d31684fc9a 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -4,7 +4,7 @@ # build and test Elasticsearch for this branch. Valid Java versions # are 'java' or 'openjdk' followed by the major release number. -ES_BUILD_JAVA=openjdk12 +ES_BUILD_JAVA=openjdk13 ES_RUNTIME_JAVA=java8 GRADLE_TASK=build GRADLE_EXTRA_ARGS= diff --git a/.ci/matrix-build-javas.yml b/.ci/matrix-build-javas.yml index 202fd60edea4c..49b904f2c32ac 100644 --- a/.ci/matrix-build-javas.yml +++ b/.ci/matrix-build-javas.yml @@ -6,4 +6,4 @@ # or 'openjdk' followed by the major release number. ES_BUILD_JAVA: - - openjdk12 + - openjdk13 diff --git a/.ci/matrix-runtime-javas.yml b/.ci/matrix-runtime-javas.yml index 31cb4eb6b736d..d9f69b6c1dc88 100644 --- a/.ci/matrix-runtime-javas.yml +++ b/.ci/matrix-runtime-javas.yml @@ -9,13 +9,10 @@ ES_RUNTIME_JAVA: - java8 - java8fips - java11 - - java12 - - openjdk12 - openjdk13 - openjdk14 - zulu8 - zulu11 - - zulu12 - corretto11 - corretto8 - adoptopenjdk11 diff --git a/.ci/packer_cache.sh b/.ci/packer_cache.sh index 9f48efc82d6a5..759a3aae9aeb6 100755 --- a/.ci/packer_cache.sh +++ b/.ci/packer_cache.sh @@ -20,6 +20,7 @@ export JAVA_HOME="${HOME}"/.java/${ES_BUILD_JAVA} # We are caching BWC versions too, need these so we can build those export JAVA8_HOME="${HOME}"/.java/java8 export JAVA11_HOME="${HOME}"/.java/java11 -export JAVA12_HOME="${HOME}"/.java/java12 +export JAVA12_HOME="${HOME}"/.java/openjdk12 +export JAVA13_HOME="${HOME}"/.java/openjdk13 ./gradlew --parallel clean --scan -Porg.elasticsearch.acceptScanTOS=true -s resolveAllDependencies diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa95be59f0165..1977f147768c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,16 +92,16 @@ Contributing to the Elasticsearch codebase **Repository:** [https://github.com/elastic/elasticsearch](https://github.com/elastic/elasticsearch) -JDK 12 is required to build Elasticsearch. You must have a JDK 12 installation +JDK 13 is required to build Elasticsearch. You must have a JDK 13 installation with the environment variable `JAVA_HOME` referencing the path to Java home for -your JDK 12 installation. By default, tests use the same runtime as `JAVA_HOME`. +your JDK 13 installation. By default, tests use the same runtime as `JAVA_HOME`. However, since Elasticsearch supports JDK 8, the build supports compiling with -JDK 12 and testing on a JDK 8 runtime; to do this, set `RUNTIME_JAVA_HOME` +JDK 13 and testing on a JDK 8 runtime; to do this, set `RUNTIME_JAVA_HOME` pointing to the Java home of a JDK 8 installation. Note that this mechanism can be used to test against other JDKs as well, this is not only limited to JDK 8. > Note: It is also required to have `JAVA8_HOME`, `JAVA9_HOME`, `JAVA10_HOME` -and `JAVA11_HOME` available so that the tests can pass. +and `JAVA11_HOME`, and `JAVA12_HOME` available so that the tests can pass. > Warning: do not use `sdkman` for Java installations which do not have proper `jrunscript` for jdk distributions. diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java index 70f80c1695de9..f98be1693232c 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/DistroTestPlugin.java @@ -73,7 +73,7 @@ public class DistroTestPlugin implements Plugin { private static final Logger logger = Logging.getLogger(DistroTestPlugin.class); - private static final String GRADLE_JDK_VERSION = "12.0.1+12@69cfe15208a647278a19ef0990eea691"; + private static final String GRADLE_JDK_VERSION = "13.0.1+9@cec27d702aa74d5a8630c65ae61e4305"; private static final String GRADLE_JDK_VENDOR = "openjdk"; // all distributions used by distro tests. this is temporary until tests are per distribution diff --git a/buildSrc/src/main/resources/minimumCompilerVersion b/buildSrc/src/main/resources/minimumCompilerVersion index 35d51f33b34f9..b1bd38b62a080 100644 --- a/buildSrc/src/main/resources/minimumCompilerVersion +++ b/buildSrc/src/main/resources/minimumCompilerVersion @@ -1 +1 @@ -1.12 \ No newline at end of file +13