diff --git a/CHANGELOG.md b/CHANGELOG.md index 81d4e7bb7..51fc0b4f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Bug Fixes ### Infrastructure * Removed JDK 11 and 17 version from CI runs [#1921](https://github.com/opensearch-project/k-NN/pull/1921) +* Upgrade min JDK compatibility to JDK 21 [#2422](https://github.com/opensearch-project/k-NN/pull/2422) ### Documentation ### Maintenance ### Refactoring diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 7ea8d26de..8df0dc17d 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -2,7 +2,7 @@ - [Getting Started](#getting-started) - [Fork OpenSearch k-NN Repo](#fork-opensearch-k-nn-repo) - [Install Prerequisites](#install-prerequisites) - - [JDK 11](#jdk-11) + - [JDK 21](#jdk-21) - [CMake](#cmake) - [Faiss Dependencies](#Faiss-Dependencies) - [Environment](#Environment) @@ -39,23 +39,20 @@ git clone https://github.com/[your username]/OpenSearch.git ### Install Prerequisites -#### JDK 11 +#### JDK 21 -OpenSearch builds using Java 11 at a minimum. This means you must have a JDK 11 installed with the environment variable -`JAVA_HOME` referencing the path to Java home for your JDK 11 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-11`. +OpenSearch builds using Java 21 at a minimum. This means you must have a JDK 21 installed with the environment variable +`JAVA_HOME` referencing the path to Java home for your JDK 21 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-21`. -One easy way to get Java 11 on *nix is to use [sdkman](https://sdkman.io/). +One easy way to get Java 21 on *nix is to use [sdkman](https://sdkman.io/). ```bash curl -s "https://get.sdkman.io" | bash source ~/.sdkman/bin/sdkman-init.sh -sdk install java 11.0.2-open -sdk use java 11.0.2-open +sdk install java 21.0.2-open +sdk use java 21.0.2-open ``` -Team has to replace minimum JDK version 14 as it was not an LTS release. JDK 14 should still work for most scenarios. -In addition to this, the plugin has been tested with JDK 17, and this JDK version is fully supported. - #### CMake The plugin requires that cmake >= 3.24.0 is installed in order to build the JNI libraries. @@ -201,10 +198,10 @@ Please follow these formatting guidelines: OpenSearch k-NN uses a [Gradle](https://docs.gradle.org/6.6.1/userguide/userguide.html) wrapper for its build. Run `gradlew` on Unix systems. -Tests use `JAVA11_HOME` environment variable, make sure to add it in the export path else the tests might fail. +Tests use `JAVA21_HOME` environment variable, make sure to add it in the export path else the tests might fail. e.g ``` -echo "export JAVA11_HOME=" >> ~/.zshrc +echo "export JAVA21_HOME=" >> ~/.zshrc source ~/.zshrc ``` diff --git a/build.gradle b/build.gradle index 72d66abad..9a3ca673f 100644 --- a/build.gradle +++ b/build.gradle @@ -192,7 +192,7 @@ allprojects { } apply from: rootProject.file('build-tools/repositories.gradle').absoluteFile plugins.withId('java') { - sourceCompatibility = targetCompatibility = "11" + sourceCompatibility = targetCompatibility = "21" } afterEvaluate { diff --git a/qa/build.gradle b/qa/build.gradle index 0d0b4ae89..34cd484d7 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -46,6 +46,13 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { file_ext = "zip" } +allprojects { + java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } +} + // Task to pull k-NN plugin from archive task pullBwcPlugin { doFirst {