Skip to content

Commit

Permalink
Adding JDK 11 to CI and docs (#271)
Browse files Browse the repository at this point in the history
Adding JDK 11 to CI matrix of java versions, replacing as minimum prerequisite in Dev readme guide. Main reason for change - JDK 11 is the latest supported LTS.

Signed-off-by: Martin Gaievski <[email protected]>
  • Loading branch information
martin-gaievski authored Jan 27, 2022
1 parent 76ec5cd commit 7e9d4c5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
Build-k-NN:
strategy:
matrix:
java: [14]
java: [11, 14]

name: Build and Test k-NN Plugin
runs-on: ubuntu-latest
Expand Down
18 changes: 10 additions & 8 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- [Getting Started](#getting-started)
- [Fork OpenSearch k-NN Repo](#fork-opensearch-k-nn-repo)
- [Install Prerequisites](#install-prerequisites)
- [JDK 14](#jdk-14)
- [JDK 11](#jdk-11)
- [Use an Editor](#use-an-editor)
- [IntelliJ IDEA](#intellij-idea)
- [Build](#build)
Expand Down Expand Up @@ -33,20 +33,22 @@ git clone https://github.com/[your username]/OpenSearch.git

### Install Prerequisites

#### JDK 14
#### JDK 11

OpenSearch builds using Java 14 at a minimum. This means you must have a JDK 14 installed with the environment variable
`JAVA_HOME` referencing the path to Java home for your JDK 14 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-14`.
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`.

One easy way to get Java 14 on *nix is to use [sdkman](https://sdkman.io/).
One easy way to get Java 11 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 14.0.2-open
sdk use java 14.0.2-open
sdk install java 11.0.2-open
sdk use java 11.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.

#### CMake

The plugin requires that cmake >= 3.17.2 is installed in order to build the JNI libraries.
Expand All @@ -64,7 +66,7 @@ Currently, the plugin only supports Linux on x64 and arm platforms.

### IntelliJ IDEA

When importing into IntelliJ you will need to define an appropriate JDK. The convention is that **this SDK should be named "14"**, and the project import will detect it automatically. For more details on defining an SDK in IntelliJ please refer to [this documentation](https://www.jetbrains.com/help/idea/sdk.html#define-sdk). Note that SDK definitions are global, so you can add the JDK from any project, or after project import. Importing with a missing JDK will still work, IntelliJ will report a problem and will refuse to build until resolved.
When importing into IntelliJ you will need to define an appropriate JDK. The convention is that **this SDK should be named "11"**, and the project import will detect it automatically. For more details on defining an SDK in IntelliJ please refer to [this documentation](https://www.jetbrains.com/help/idea/sdk.html#define-sdk). Note that SDK definitions are global, so you can add the JDK from any project, or after project import. Importing with a missing JDK will still work, IntelliJ will report a problem and will refuse to build until resolved.

You can import the OpenSearch project into IntelliJ IDEA as follows.

Expand Down

0 comments on commit 7e9d4c5

Please sign in to comment.