Skip to content

Commit

Permalink
Update JDK from 21 to 23 (#12166)
Browse files Browse the repository at this point in the history
* Update JDK from 21 to 23

* Update dependencies

* Also use JDK 23 for JavaFX EA build

* Use correct tag
  • Loading branch information
koppor authored Nov 9, 2024
1 parent 897253e commit 5009767
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Install java.
// See https://github.com/devcontainers/features/tree/main/src/java#options for details.
"ghcr.io/devcontainers/features/java:1": {
"version": "21.0.2-tem",
"version": "23.0.1-tem",
"installGradle": false,
"jdkDistro": "Temurin"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Clean up keychain
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment-jdk-ea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, buildjet-8vcpu-ubuntu-2204-arm]
jdk: [21]
jdk: [23]
javafx: [24]
include:
- os: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-fetchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Run checkstyle reporter
uses: dbelyaev/action-checkstyle@master
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand All @@ -87,7 +87,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down Expand Up @@ -309,7 +309,7 @@ jobs:
if: github.ref == 'refs/heads/main'
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-gradle-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 21.0.5
java-version: 23.0.1
distribution: 'temurin'

- name: Update Gradle Wrapper
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ FROM gitpod/workspace-full
# All available versions can be listed using sdk ls java
# More information about SDKMAN available at https://github.com/sdkman/sdkman-cli#sdkman-cli
RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
&& sdk install java 21-open"
&& sdk install java 23-open"
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.jabref.build.xjc.XjcTask
plugins {
id 'application'

id 'com.github.andygoossens.modernizer' version '1.9.3'
id 'com.github.andygoossens.modernizer' version '1.10.0'

id 'me.champeau.jmh' version '0.7.2'

Expand All @@ -15,7 +15,7 @@ plugins {

id 'org.openjfx.javafxplugin' version '0.1.0'

id 'org.beryx.jlink' version '3.0.1'
id 'org.beryx.jlink' version '3.1.0-rc-1'

// nicer test outputs during running and completion
// Homepage: https://github.com/radarsh/gradle-test-logger-plugin
Expand Down Expand Up @@ -45,8 +45,8 @@ group = "org.jabref"
version = project.findProperty('projVersion') ?: '100.0.0'

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_23
targetCompatibility = JavaVersion.VERSION_23

// Workaround needed for Eclipse, probably because of https://github.com/gradle/gradle/issues/16922
// Should be removed as soon as Gradle 7.0.1 is released ( https://github.com/gradle/gradle/issues/16922#issuecomment-828217060 )
Expand All @@ -60,7 +60,7 @@ java {
// - .github/workflows/tests*.yml
// - .github/workflows/update-gradle-wrapper.yml
// - docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.md
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(23)
// See https://docs.gradle.org/current/javadoc/org/gradle/jvm/toolchain/JvmVendorSpec.html for a full list
// vendor = JvmVendorSpec.AMAZON
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ nav_order: 12

# Step 2: Set up the build system: JDK and Gradle

## Ensure that JDK 21 is available to IntelliJ
## Ensure that JDK 23 is available to IntelliJ

Ensure you have a Java 21 SDK configured by navigating to **File > Project Structure... > Platform Settings > SDKs**.<br>
Ensure you have a Java 23 SDK configured by navigating to **File > Project Structure... > Platform Settings > SDKs**.<br>
**Note:** In some MacBooks, `Project Structure` can be found at the "IntelliJ" button of the app menu instead of at "File".

{% figure caption:"JDKs 11, 14, and 15 shown in available SDKs. JDK 21 is missing." %}
{% figure caption:"JDKs 11, 14, and 15 shown in available SDKs. JDK 23 is missing." %}
![Plattform Settings - SDKs](intellij-choose-jdk-adoptopenjdk-on-windows-project-settings.png)
{% endfigure %}

If there is another JDK than JDK 21 selected, click on the plus button and choose "Download JDK..."
If there is another JDK than JDK 23 selected, click on the plus button and choose "Download JDK..."

{% figure caption:"Download JDK..." %}
![Plattform Settings - SDKs - plus button - Download JDK...](guidelines-select-download-jdk.png)
{% endfigure %}

Select JDK version 21 and then Eclipse Temurin.
Select JDK version 23 and then Eclipse Temurin.

{% figure caption:"Example for JDK 21 - Choose Eclipse Temurin" %}
{% figure caption:"Example for JDK 23 - Choose Eclipse Temurin" %}
![Download Eclipse Temurin](guidelines-intellij-select-jdk-eclipse-temurin.png)
{% endfigure %}

Expand All @@ -33,20 +33,20 @@ After clicking "Download", IntelliJ installs Eclipse Temurin:
![IntelliJ installs Eclipse Temurin](guidelines-intellij-installs-temurin.png)
{% endfigure %}

Navigate to **Project Settings > Project** and ensure that the projects' SDK is Java 21.
Navigate to **Project Settings > Project** and ensure that the projects' SDK is Java 23.

{% figure caption:"Project SDK is pinned to the downloaded SDK (showing JDK 21 as example)" %}
![Project SDK is JDK 21](guidelines-intellij-project-settings-jdk.png)
{% figure caption:"Project SDK is pinned to the downloaded SDK (showing JDK 23 as example)" %}
![Project SDK is JDK 23](guidelines-intellij-project-settings-jdk.png)
{% endfigure %}

Click "OK" to store the changes.

## Ensure correct JDK setting for Gradle

Navigate to **File > Settings... > Build, Execution, Deployment > Build Tools > Gradle** and select the "Project SDK" as the Gradle JVM at the bottom.
If that does not exist, just select JDK 21.
If that does not exist, just select JDK 23.

{% figure caption:"Gradle JVM is project SDK (showing "Projekt SDK temurin-21" as example)" %}
{% figure caption:"Gradle JVM is project SDK (showing "Projekt SDK temurin-23" as example)" %}
![Gradle JVM is project SDK](guidelines-intellij-settings-gradle-gradlejvm-is-projectjvm.png)
{% endfigure %}

Expand Down

0 comments on commit 5009767

Please sign in to comment.