Adding support for JDK17 and removing JDK8 (#2025)

* Adding support for JDK17 and removing JDK8

Signed-off-by: Martin Gaievski <gaievski@amazon.com>

* Merge overlaping PR, bumping min java version to 11

Signed-off-by: Martin Gaievski <gaievski@amazon.com>

* Removing references to JDK8 from dev guide

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
This commit is contained in:
Martin Gaievski 2022-02-02 17:59:10 -08:00 committed by GitHub
parent 270c59f523
commit 309397520c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 14 additions and 16 deletions

View File

@ -14,6 +14,6 @@
# are 'java' or 'openjdk' followed by the major release number.
OPENSEARCH_BUILD_JAVA=openjdk11
OPENSEARCH_RUNTIME_JAVA=java8
OPENSEARCH_RUNTIME_JAVA=java11
GRADLE_TASK=build
GRADLE_EXTRA_ARGS=

View File

@ -3,7 +3,7 @@
- [Git Clone OpenSearch Repo](#git-clone-opensearch-repo)
- [Install Prerequisites](#install-prerequisites)
- [JDK 11](#jdk-11)
- [JDK 8 and 14](#jdk-8-and-14)
- [JDK 14](#jdk-14)
- [Runtime JDK](#runtime-jdk)
- [Windows](#windows)
- [Docker](#docker)
@ -65,13 +65,13 @@ OpenSearch builds using Java 11 at a minimum. This means you must have a JDK 11
Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk11).
#### JDK 8 and 14
#### JDK 14
To run the full suite of tests, download and install [JDK 8](https://adoptium.net/releases.html?variant=openjdk8) and [JDK 14](https://jdk.java.net/archive/) and set `JAVA8_HOME`, `JAVA11_HOME`, and `JAVA14_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility).
To run the full suite of tests, download and install [JDK 14](https://jdk.java.net/archive/) and set `JAVA11_HOME`, and `JAVA14_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility).
#### Runtime JDK
By default, the test tasks use bundled JDK runtime, configured in `buildSrc/version.properties` and set to JDK 17 (LTS). Other kind of test tasks (integration, cluster, ... ) use the same runtime as `JAVA_HOME`. However, since OpenSearch supports JDK 8 as the runtime, the build supports compiling with JDK 11 and testing on a different version of JDK runtime. To do this, set `RUNTIME_JAVA_HOME` pointing to the Java home of another JDK installation, e.g. `RUNTIME_JAVA_HOME=/usr/lib/jvm/jdk-8`. Alternatively, the runtime JDK version could be provided as the command line argument, using combination of `runtime.java=<major JDK version>` property and `JAVA<major JDK version>_HOME` environment variable, for example `./gradlew -Druntime.java=17 ...` (in this case, the tooling expects `JAVA17_HOME` environment variable to be set).
By default, the test tasks use bundled JDK runtime, configured in `buildSrc/version.properties` and set to JDK 17 (LTS). Other kind of test tasks (integration, cluster, ... ) use the same runtime as `JAVA_HOME`. However, the build supports compiling with JDK 11 and testing on a different version of JDK runtime. To do this, set `RUNTIME_JAVA_HOME` pointing to the Java home of another JDK installation, e.g. `RUNTIME_JAVA_HOME=/usr/lib/jvm/jdk-14`. Alternatively, the runtime JDK version could be provided as the command line argument, using combination of `runtime.java=<major JDK version>` property and `JAVA<major JDK version>_HOME` environment variable, for example `./gradlew -Druntime.java=17 ...` (in this case, the tooling expects `JAVA17_HOME` environment variable to be set).
#### Windows

View File

@ -158,8 +158,8 @@ if (project != rootProject) {
apply plugin: 'opensearch.publish'
allprojects {
targetCompatibility = 10
sourceCompatibility = 10
targetCompatibility = 11
sourceCompatibility = 11
}
// groovydoc succeeds, but has some weird internal exception...

View File

@ -28,5 +28,5 @@
# under the License.
#
OPENSEARCH_BUILD_JAVA=openjdk11
OPENSEARCH_RUNTIME_JAVA=java8
OPENSEARCH_RUNTIME_JAVA=java11
GRADLE_TASK=build

View File

@ -1867,7 +1867,6 @@ public final class IndicesClient {
/**
* Validate a potentially expensive query without executing it.
* <p>
*
* @param validateQueryRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@ -1886,7 +1885,6 @@ public final class IndicesClient {
/**
* Asynchronously validate a potentially expensive query without executing it.
* <p>
*
* @param validateQueryRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized

View File

@ -175,7 +175,6 @@ public final class IngestClient {
/**
* Simulate a pipeline on a set of documents provided in the request
* <p>
*
* @param request the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@ -194,7 +193,6 @@ public final class IngestClient {
/**
* Asynchronously simulate a pipeline on a set of documents provided in the request
* <p>
*
* @param request the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized

View File

@ -293,7 +293,6 @@ public final class SnapshotClient {
/**
* Asynchronously creates a snapshot.
* <p>
*
* @return cancellable that may be used to cancel the request
*/
@ -327,7 +326,6 @@ public final class SnapshotClient {
/**
* Asynchronously clones a snapshot.
* <p>
*
* @return cancellable that may be used to cancel the request
*/

View File

@ -11,7 +11,12 @@
org.gradle.warning.mode=none
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Xss2m
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Xss2m \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
options.forkOptions.memoryMaximumSize=2g
# Disable duplicate project id detection

View File

@ -48,7 +48,6 @@ import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
* padding is indistinguishable from valid information. To overcome this
* problem, a char is appended, indicating the number of encoded bytes in the
* final content char.
* <p>
*
* @deprecated Implement {@link TermToBytesRefAttribute} and store bytes directly
* instead. This class WAS removed in Lucene 5.0