From 10d2cf362081e1b9d24f8e9bd73d0434604f23f9 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sat, 25 Jan 2025 17:48:44 -0800 Subject: [PATCH 1/2] maven: switch to maven.compiler.release Build with --release instead of -source and -target, to ensure we use the correct language rules and system classes. Fixes build warning on Java > 22: Warning: location of system modules is not set in conjunction with -source 22 not setting the location of system modules may lead to class files that cannot run on JDK 22 --release 22 is recommended instead of -source 22 -target 22 because it sets the location of system modules automatically Signed-off-by: Benjamin Gilbert --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 84bbbd3..d4008c8 100644 --- a/pom.xml +++ b/pom.xml @@ -25,8 +25,7 @@ UTF-8 - 22 - 22 + 22 From 4c6dec316fc0dbc824986d3e3f0ccb3ef8208842 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sat, 25 Jan 2025 18:40:17 -0800 Subject: [PATCH 2/2] workflows: test on both minimum and latest Java It should be safe to generate the dist jar with the latest Java, but just to be sure, continue using Java 22. setup-java doesn't provide an alias for the latest Java release, so specify it by version. Signed-off-by: Benjamin Gilbert --- .github/workflows/java.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java.yaml b/.github/workflows/java.yaml index 7b80fbf..6e9be7c 100644 --- a/.github/workflows/java.yaml +++ b/.github/workflows/java.yaml @@ -19,8 +19,10 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] + java: [22, 23] include: - os: ubuntu-latest + java: 22 dist: dist defaults: run: @@ -32,7 +34,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: oracle - java-version: 22 + java-version: ${{ matrix.java }} cache: maven - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-latest'