Skip to content

Commit

Permalink
Switch to JDK 20 (#9767)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Apr 18, 2023
1 parent 79d6ddc commit e3e44a3
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 35 deletions.
7 changes: 4 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"extensions": [
"vscjava.vscode-java-pack",
"vscjava.vscode-gradle",
"shengchen.vscode-checkstyle"
"shengchen.vscode-checkstyle",
"DavidAnson.vscode-markdownlint"
]
}
},
Expand All @@ -35,8 +36,8 @@

// Install java
"java": {
"version": "18",
"installGradle": true,
"version": "20",
"installGradle": false,
"jdkDistro": "sem"
}
}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/deployment-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
branches:
- arm64mac-release


env:
SpringerNatureAPIKey: ${{ secrets.SpringerNatureAPIKey }}
AstrophysicsDataSystemAPIKey: ${{ secrets.AstrophysicsDataSystemAPIKey }}
Expand Down Expand Up @@ -59,8 +58,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 19
distribution: 'liberica'
java-version: 20
distribution: 'temurin'
cache: 'gradle'
- name: Clean up keychain
if: (matrix.os == 'self-hosted') && (steps.checksecrets.outputs.secretspresent == 'YES')
Expand Down
8 changes: 4 additions & 4 deletions .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: 19
java-version: 20
distribution: 'temurin'
cache: 'gradle'
- name: Setup OSX key chain on OSX
Expand Down Expand Up @@ -112,11 +112,11 @@ jobs:
jpackage --type pkg --dest build/distribution --name JabRef --mac-package-identifier JabRef --app-version "${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}" --app-image build/distribution/JabRef.app --verbose --type pkg --vendor JabRef --app-version "${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}" --file-associations buildres/mac/bibtexAssociations.properties --resource-dir buildres/mac
productsign --sign "Developer ID Installer: JabRef e.V. (6792V39SK3)" "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}.pkg" "build/distribution/JabRef-${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-signed.pkg"
- name: Package application image
if: (matrix.os != 'macos-latest')
# if: (matrix.os != 'macos-latest')
shell: bash
run: ${{ matrix.archivePortable }}
- name: Rename files
if: (matrix.os != 'macos-latest')
# if: (matrix.os != 'macos-latest')
shell: pwsh
run: |
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"}
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
- name: Package application image
if: (steps.checksecrets.outputs.secretspresent == 'YES')
shell: bash
run: brew install pigz && tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app
run: ${{ matrix.archivePortable }}
- name: Rename files
if: (steps.checksecrets.outputs.secretspresent == 'YES')
shell: pwsh
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 @@ -21,7 +21,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 19
java-version: 20
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: 19
java-version: 20
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: 19
java-version: 20
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: 19
java-version: 20
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: 19
java-version: 20
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: 19
java-version: 20
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: 19
java-version: 20
distribution: 'temurin'
cache: 'gradle'
- name: Update test coverage metrics
Expand Down
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"valentjn.vscode-ltex"
]
}
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 19 and `JAVA_HOME` pointing to this JDK.
To compile JabRef from source, you need a Java Development Kit 20 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_19
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
// 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 )
modularity.inferModulePath.set(false)
Expand Down
Original file line number Diff line number Diff line change
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-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)).
For advanced users, [Eclipse](https://eclipse.org) (`2023-03` or newer) is also possible. For JDK20 you need to install the addtional [support for jdk20 as extension](https://marketplace.eclipse.org/content/java-20-support-eclipse-2023-03-427)).
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 19
### Java Development Kit 20

For Eclipse, a working Java (Development Kit) 19 installation is required.
For Eclipse, a working Java (Development Kit) 20 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 19 (e.g., `javac 19`).
In the command line (terminal in Linux, cmd in Windows) run `javac -version` and make sure that the reported version is Java 20 (e.g., `javac 20`).
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 19.
Please head to <https://adoptium.net/de/temurin/releases> to download JDK 20.


## Get the code
Expand Down Expand Up @@ -166,21 +166,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 19 is available to IntelliJ
### Ensure that JDK 20 is available to IntelliJ

Ensure you have a Java 19 SDK configured by navigating to **File > Project Structure... > Platform Settings > SDKs**.
Ensure you have a Java 20 SDK configured by navigating to **File > Project Structure... > Platform Settings > SDKs**.

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

If there is another JDK than JDK 19 selected, click on the plus button and choose "Download JDK..."
If there is another JDK than JDK 20 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 19 and then Eclipse Temurin (showing JDK 18 as example).
Select JDK version 20 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 @@ -192,7 +192,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 19
Navigate to **Project Settings > Project** and ensure that the projects' SDK is Java 20

{% 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 @@ -202,7 +202,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 19.
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 20.

{% 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 @@ -578,7 +578,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 19 is installed is following error message:
An indication that `JAVA_HOME` is not correctly set or no JDK 20 is installed is following error message:

```text
compileJava FAILED
Expand Down Expand Up @@ -629,9 +629,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-19-mac.jar (org.openjfx:javafx-fxml:19).
> Could not find javafx-fxml-20-mac.jar (org.openjfx:javafx-fxml:20).
Searched in the following locations:
file:<your local maven repository path>/repository/org/openjfx/javafx-fxml/19/javafx-fxml-19-mac.jar
file:<your local maven repository path>/repository/org/openjfx/javafx-fxml/20/javafx-fxml-20-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 e3e44a3

Please sign in to comment.