Skip to content

Commit

Permalink
Update to JDK 19 (#9421)
Browse files Browse the repository at this point in the history
* Update to JDK 19

* update eclipse hint

* update modernizer

* update jlink plugin to 2.26

Co-authored-by: Christoph <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
  • Loading branch information
3 people authored Dec 26, 2022
1 parent bfcd0fe commit 7fc7361
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/refresh-journal-lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <https://adoptium.net/de/temurin/releases> to download JDK 18.
Please head to <https://adoptium.net/de/temurin/releases> to download JDK 19.
Note that JDK 19 does not work.

## Get the code
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:<your local maven repository path>/repository/org/openjfx/javafx-fxml/18/javafx-fxml-18-mac.jar
file:<your local maven repository path>/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.
Expand Down

0 comments on commit 7fc7361

Please sign in to comment.