Skip to content

Commit 3093975

Browse files
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>
1 parent 270c59f commit 3093975

File tree

9 files changed

+14
-16
lines changed

9 files changed

+14
-16
lines changed

.ci/java-versions.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
# are 'java' or 'openjdk' followed by the major release number.
1515

1616
OPENSEARCH_BUILD_JAVA=openjdk11
17-
OPENSEARCH_RUNTIME_JAVA=java8
17+
OPENSEARCH_RUNTIME_JAVA=java11
1818
GRADLE_TASK=build
1919
GRADLE_EXTRA_ARGS=

DEVELOPER_GUIDE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- [Git Clone OpenSearch Repo](#git-clone-opensearch-repo)
44
- [Install Prerequisites](#install-prerequisites)
55
- [JDK 11](#jdk-11)
6-
- [JDK 8 and 14](#jdk-8-and-14)
6+
- [JDK 14](#jdk-14)
77
- [Runtime JDK](#runtime-jdk)
88
- [Windows](#windows)
99
- [Docker](#docker)
@@ -65,13 +65,13 @@ OpenSearch builds using Java 11 at a minimum. This means you must have a JDK 11
6565

6666
Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk11).
6767

68-
#### JDK 8 and 14
68+
#### JDK 14
6969

70-
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).
70+
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).
7171

7272
#### Runtime JDK
7373

74-
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).
74+
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).
7575

7676
#### Windows
7777

buildSrc/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ if (project != rootProject) {
158158
apply plugin: 'opensearch.publish'
159159

160160
allprojects {
161-
targetCompatibility = 10
162-
sourceCompatibility = 10
161+
targetCompatibility = 11
162+
sourceCompatibility = 11
163163
}
164164

165165
// groovydoc succeeds, but has some weird internal exception...

buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/.ci/java-versions.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
# under the License.
2929
#
3030
OPENSEARCH_BUILD_JAVA=openjdk11
31-
OPENSEARCH_RUNTIME_JAVA=java8
31+
OPENSEARCH_RUNTIME_JAVA=java11
3232
GRADLE_TASK=build

client/rest-high-level/src/main/java/org/opensearch/client/IndicesClient.java

-2
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,6 @@ public Cancellable simulateIndexTemplateAsync(
18671867

18681868
/**
18691869
* Validate a potentially expensive query without executing it.
1870-
* <p>
18711870
*
18721871
* @param validateQueryRequest the request
18731872
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -1886,7 +1885,6 @@ public ValidateQueryResponse validateQuery(ValidateQueryRequest validateQueryReq
18861885

18871886
/**
18881887
* Asynchronously validate a potentially expensive query without executing it.
1889-
* <p>
18901888
*
18911889
* @param validateQueryRequest the request
18921890
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized

client/rest-high-level/src/main/java/org/opensearch/client/IngestClient.java

-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ public Cancellable deletePipelineAsync(
175175

176176
/**
177177
* Simulate a pipeline on a set of documents provided in the request
178-
* <p>
179178
*
180179
* @param request the request
181180
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -194,7 +193,6 @@ public SimulatePipelineResponse simulate(SimulatePipelineRequest request, Reques
194193

195194
/**
196195
* Asynchronously simulate a pipeline on a set of documents provided in the request
197-
* <p>
198196
*
199197
* @param request the request
200198
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized

client/rest-high-level/src/main/java/org/opensearch/client/SnapshotClient.java

-2
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ public CreateSnapshotResponse create(CreateSnapshotRequest createSnapshotRequest
293293

294294
/**
295295
* Asynchronously creates a snapshot.
296-
* <p>
297296
*
298297
* @return cancellable that may be used to cancel the request
299298
*/
@@ -327,7 +326,6 @@ public AcknowledgedResponse clone(CloneSnapshotRequest cloneSnapshotRequest, Req
327326

328327
/**
329328
* Asynchronously clones a snapshot.
330-
* <p>
331329
*
332330
* @return cancellable that may be used to cancel the request
333331
*/

gradle.properties

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
org.gradle.warning.mode=none
1313
org.gradle.parallel=true
14-
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Xss2m
14+
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Xss2m \
15+
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
16+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
17+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
18+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
19+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
1520
options.forkOptions.memoryMaximumSize=2g
1621

1722
# Disable duplicate project id detection

plugins/analysis-icu/src/main/java/org/opensearch/index/analysis/IndexableBinaryStringTools.java

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
* padding is indistinguishable from valid information. To overcome this
4949
* problem, a char is appended, indicating the number of encoded bytes in the
5050
* final content char.
51-
* <p>
5251
*
5352
* @deprecated Implement {@link TermToBytesRefAttribute} and store bytes directly
5453
* instead. This class WAS removed in Lucene 5.0

0 commit comments

Comments
 (0)