From 7fc736172af271c68f30bf863fea31af9ca31438 Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Mon, 26 Dec 2022 18:42:15 +0100 Subject: [PATCH] Update to JDK 19 (#9421) * Update to JDK 19 * update eclipse hint * update modernizer * update jlink plugin to 2.26 Co-authored-by: Christoph Co-authored-by: Oliver Kopp --- .github/workflows/deployment.yml | 2 +- .github/workflows/refresh-journal-lists.yml | 2 +- .github/workflows/tests-fetchers.yml | 2 +- .github/workflows/tests.yml | 10 +++--- README.md | 2 +- build.gradle | 4 +-- ...elines-for-setting-up-a-local-workspace.md | 32 +++++++++---------- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f73a8a9734d..1b6c1b7b4c3 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -75,7 +75,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Setup OSX key chain on OSX diff --git a/.github/workflows/refresh-journal-lists.yml b/.github/workflows/refresh-journal-lists.yml index d975875963a..9312ebcd42b 100644 --- a/.github/workflows/refresh-journal-lists.yml +++ b/.github/workflows/refresh-journal-lists.yml @@ -24,7 +24,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Update journal lists diff --git a/.github/workflows/tests-fetchers.yml b/.github/workflows/tests-fetchers.yml index 66148b73038..d7a77a51ca5 100644 --- a/.github/workflows/tests-fetchers.yml +++ b/.github/workflows/tests-fetchers.yml @@ -43,7 +43,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Run fetcher tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e958a75816e..02c2f795049 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Run check style reporter @@ -57,7 +57,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Run tests @@ -89,7 +89,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Run tests on PostgreSQL @@ -123,7 +123,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Run GUI tests @@ -161,7 +161,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 18 + java-version: 19 distribution: 'temurin' cache: 'gradle' - name: Update test coverage metrics diff --git a/README.md b/README.md index 60e3335e4f2..1134969f30f 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ We will discuss improvements with you and agree to merge them once the [develope If you want a step-by-step walk-through on how to set-up your workspace, please check [this guideline](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace). -To compile JabRef from source, you need a Java Development Kit 18 and `JAVA_HOME` pointing to this JDK. +To compile JabRef from source, you need a Java Development Kit 19 and `JAVA_HOME` pointing to this JDK. To run it, just execute `gradlew run`. When you want to develop, it is necessary to generate additional sources using `gradlew generateSource` and then generate the Eclipse `gradlew eclipse`. diff --git a/build.gradle b/build.gradle index 2705ddc1111..b51bc13ac51 100644 --- a/build.gradle +++ b/build.gradle @@ -40,8 +40,8 @@ group = "org.jabref" version = project.findProperty('projVersion') ?: '100.0.0' java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_19 + targetCompatibility = JavaVersion.VERSION_19 // 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 ) diff --git a/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md b/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md index bfd13f0ad37..340593b4f0f 100644 --- a/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md +++ b/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md @@ -10,7 +10,7 @@ This guide explains how to set up your environment for development of JabRef. It The most important step is to configure your IDE. If you know how to fork and check out JabRef's code, already have an IDE installed, then -please scroll down to the [IDE setup](#configure-your-ide). +please scroll down to the [IDE setup](#Get the code into your IDE). Otherwise, please keep on reading. ## Prerequisites @@ -51,18 +51,18 @@ We suggest [IntelliJ IDEA](https://www.jetbrains.com/idea/?from=jabref). The Community Edition works well. Most contributors use the Ultimate Edition, because they are students getting that edition for free. -For advanced users, [Eclipse](https://eclipse.org) (`2022-03` or newer) is also possible. +For advanced users, [Eclipse](https://eclipse.org) (`2022-09` or newer) is also possible. For JDK19 you need to install the addtional [support for jdk19 as extension](https://marketplace.eclipse.org/content/java-19-support-eclipse-2022-09-425)). On Ubuntu Linux, you can follow the [documentation from the Ubuntu Community](https://help.ubuntu.com/community/EclipseIDE#Download\_Eclipse) or the [step-by-step guideline from Krizna](https://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/) to install Eclipse. On Windows, download it from [www.eclipse.org](http://www.eclipse.org/downloads/) and run the installer. -### Java Development Kit 18 +### Java Development Kit 19 -For Eclipse, a working Java (Development Kit) 18 installation is required. +For Eclipse, a working Java (Development Kit) 19 installation is required. In the case of IntelliJ, this will be downloaded inside the IDE (if you follow the steps below). -In the command line (terminal in Linux, cmd in Windows) run `javac -version` and make sure that the reported version is Java 18 (e.g., `javac 18`). +In the command line (terminal in Linux, cmd in Windows) run `javac -version` and make sure that the reported version is Java 19 (e.g., `javac 19`). If `javac` is not found or a wrong version is reported, check your `PATH` environment variable, your `JAVA_HOME` environment variable or install the most recent JDK. -Please head to to download JDK 18. +Please head to to download JDK 19. Note that JDK 19 does not work. ## Get the code @@ -169,21 +169,21 @@ Once set up, IntelliJ IDEA's internal system can be used for subsequent builds. In case IntelliJ's internal build system does not work, just stick with using Gradle. -### Ensure that JDK 18 is available to IntelliJ +### Ensure that JDK 19 is available to IntelliJ -Ensure you have a Java 18 SDK configured by navigating to **File > Project Structure... > Platform Settings > SDKs**. +Ensure you have a Java 19 SDK configured by navigating to **File > Project Structure... > Platform Settings > SDKs**. -{% figure caption:"JDKs 11, 14, and 15 shown in available SDKs. JDK 18 is missing." %} +{% figure caption:"JDKs 11, 14, and 15 shown in available SDKs. JDK 19 is missing." %} ![Plattform Settings - SDKs](../images/intellij-choose-jdk-adoptopenjdk-on-windows-project-settings.png) {% endfigure %} -If there is another JDK than JDK 18 selected, click on the plus button and choose "Download JDK..." +If there is another JDK than JDK 19 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 18 and then Eclipse Temurin. +Select JDK version 19 and then Eclipse Temurin (showing JDK 18 as example). {% figure caption:"Example for JDK 18 - Choose Eclipse Temurin" %} ![Download Eclipse Temurin](guidelines-select-jdk-18-eclipse-temurin.png) @@ -195,7 +195,7 @@ 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 18 +Navigate to **Project Settings > Project** and ensure that the projects' SDK is Java 19 {% figure caption:"Project SDK is pinned to the downloaded SDK (showing JDK 18 as example)" %} ![Project SDK is JDK 18](guidelines-intellij-project-settings-jdk18.png) @@ -205,7 +205,7 @@ Click "OK" to store the changes. ### Configure the Build System -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 a JDK 18. +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 a JDK 19. {% figure caption:"Gradle JVM is project SDK (showing JDK 18 as example)" %} ![Gradle JVM is project SDK](guidelines-settings-gradle-gradlejvm-is-projectjvm.png) @@ -581,7 +581,7 @@ We invite you to read on at our [tool recommendations](../code-howtos/tools.md). ### Java installation -An indication that `JAVA_HOME` is not correctly set or no JDK 18 is installed is following error message: +An indication that `JAVA_HOME` is not correctly set or no JDK 19 is installed is following error message: ```text compileJava FAILED @@ -632,9 +632,9 @@ This can include different modules. There might be problems with building if you have OpenJFX libraries in local maven repository, resulting in errors like this: ```text - > Could not find javafx-fxml-18-mac.jar (org.openjfx:javafx-fxml:18). + > Could not find javafx-fxml-19-mac.jar (org.openjfx:javafx-fxml:19). Searched in the following locations: - file:/repository/org/openjfx/javafx-fxml/18/javafx-fxml-18-mac.jar + file:/repository/org/openjfx/javafx-fxml/19/javafx-fxml-19-mac.jar ``` As a workaround, you can remove all local OpenJFX artifacts by deleting the whole OpenJFX folder from specified location.