Skip to content

Commit

Permalink
Downgrade to JDK 11. (#2301)
Browse files Browse the repository at this point in the history
* Downgrade to JDK 11.

Signed-off-by: dblock <[email protected]>

* Added support for patch JDK version, like 11.0.14+1

Signed-off-by: Andriy Redko <[email protected]>

* Use JDK 11.0.14.1+1.

Signed-off-by: dblock <[email protected]>

* ./gradlew :build-tools:spotlessApply

Signed-off-by: dblock <[email protected]>

Co-authored-by: Andriy Redko <[email protected]>
  • Loading branch information
dblock and reta authored Mar 2, 2022
1 parent a4515b9 commit 5114528
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To run the full suite of tests, download and install [JDK 8](https://adoptium.ne

#### 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 11 (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).

#### 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
4 changes: 3 additions & 1 deletion buildSrc/src/main/java/org/opensearch/gradle/Jdk.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public class Jdk implements Buildable, Iterable<File> {
private static final List<String> ALLOWED_PLATFORMS = Collections.unmodifiableList(
Arrays.asList("darwin", "freebsd", "linux", "mac", "windows")
);
private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?");
private static final Pattern VERSION_PATTERN = Pattern.compile(
"(\\d+)(\\.\\d+\\.\\d+(?:.\\d+)?)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?"
);
private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)\\+(b\\d+?)(@([a-f0-9]{32}))?");

private final String name;
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ opensearch = 1.3.0
lucene = 8.10.1

bundled_jdk_vendor = adoptium
bundled_jdk = 17.0.2+8
bundled_jdk = 11.0.14.1+1



Expand Down

0 comments on commit 5114528

Please sign in to comment.