Skip to content

Commit

Permalink
Adding support for JDK17 and removing JDK8 (#2025)
Browse files Browse the repository at this point in the history
* Adding support for JDK17 and removing JDK8

Signed-off-by: Martin Gaievski <[email protected]>

* Merge overlaping PR, bumping min java version to 11

Signed-off-by: Martin Gaievski <[email protected]>

* Removing references to JDK8 from dev guide

Signed-off-by: Martin Gaievski <[email protected]>
  • Loading branch information
martin-gaievski authored Feb 3, 2022
1 parent 270c59f commit 3093975
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ci/java-versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
8 changes: 4 additions & 4 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
# under the License.
#
OPENSEARCH_BUILD_JAVA=openjdk11
OPENSEARCH_RUNTIME_JAVA=java8
OPENSEARCH_RUNTIME_JAVA=java11
GRADLE_TASK=build
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,6 @@ public Cancellable simulateIndexTemplateAsync(

/**
* 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
Expand All @@ -1886,7 +1885,6 @@ public ValidateQueryResponse validateQuery(ValidateQueryRequest validateQueryReq

/**
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public Cancellable deletePipelineAsync(

/**
* 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
Expand All @@ -194,7 +193,6 @@ public SimulatePipelineResponse simulate(SimulatePipelineRequest request, Reques

/**
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ public CreateSnapshotResponse create(CreateSnapshotRequest createSnapshotRequest

/**
* Asynchronously creates a snapshot.
* <p>
*
* @return cancellable that may be used to cancel the request
*/
Expand Down Expand Up @@ -327,7 +326,6 @@ public AcknowledgedResponse clone(CloneSnapshotRequest cloneSnapshotRequest, Req

/**
* Asynchronously clones a snapshot.
* <p>
*
* @return cancellable that may be used to cancel the request
*/
Expand Down
7 changes: 6 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
* 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
Expand Down

0 comments on commit 3093975

Please sign in to comment.