Skip to content

Commit a48957e

Browse files
Upgrade Java version to 21 and switch to Temurin distribution (#162)
* ci: build with JDK 21 (temurin), keep bytecode target 1.8 Replace the per-job Java 8/11/17 + zulu setup-java blocks across publish.yml and codeql.yml with a single JAVA_VERSION='21' env var on temurin. Bytecode target stays at 1.8 in pom.xml — JDK 21 javac still supports --release 8 — so the JAR remains runnable on Java 8+ while CI gets to use modern Maven plugins. Update CLAUDE.md to reflect the new "built with JDK 21, runs on Java 8+" reality. * build: bump jacoco-maven-plugin 0.8.14 -> 0.8.15 Latest stable JaCoCo release (2026-05-13). Drop-in bump; restores exec file compatibility with versions 0.7.5-0.8.8 for class files with zero line numbers and pulls in ASM 9.6. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8a48f4f commit a48957e

4 files changed

Lines changed: 27 additions & 26 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v6
2323
- uses: actions/setup-java@v5
24-
with: { java-version: '11', distribution: temurin }
24+
with: { java-version: '21', distribution: temurin }
2525
- uses: github/codeql-action/init@v4
2626
with: { languages: java, queries: +security-and-quality }
2727
- name: Build with Maven

.github/workflows/publish.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ on:
2020
required: false
2121
default: 'false'
2222
env:
23+
JAVA_VERSION: '21'
2324
MODEL_URL: "https://huggingface.co/TheBloke/CodeLlama-7B-GGUF/resolve/main/codellama-7b.Q2_K.gguf"
2425
MODEL_NAME: "codellama-7b.Q2_K.gguf"
2526
RERANKING_MODEL_URL: "https://huggingface.co/gpustack/jina-reranker-v1-tiny-en-GGUF/resolve/main/jina-reranker-v1-tiny-en-Q4_0.gguf"
@@ -167,8 +168,8 @@ jobs:
167168
- uses: actions/checkout@v6
168169
- uses: actions/setup-java@v5
169170
with:
170-
distribution: 'zulu'
171-
java-version: '8'
171+
distribution: 'temurin'
172+
java-version: ${{ env.JAVA_VERSION }}
172173
- name: Display CPU Info
173174
shell: bash
174175
run: |
@@ -198,8 +199,8 @@ jobs:
198199
- uses: actions/checkout@v6
199200
- uses: actions/setup-java@v5
200201
with:
201-
distribution: 'zulu'
202-
java-version: '8'
202+
distribution: 'temurin'
203+
java-version: ${{ env.JAVA_VERSION }}
203204
- name: Display CPU Info
204205
shell: bash
205206
run: |
@@ -291,8 +292,8 @@ jobs:
291292
- uses: actions/checkout@v6
292293
- uses: actions/setup-java@v5
293294
with:
294-
distribution: 'zulu'
295-
java-version: '8'
295+
distribution: 'temurin'
296+
java-version: ${{ env.JAVA_VERSION }}
296297
- name: Display CPU Info
297298
run: |
298299
echo "=== CPU Information ==="
@@ -315,8 +316,8 @@ jobs:
315316
- uses: actions/checkout@v6
316317
- uses: actions/setup-java@v5
317318
with:
318-
distribution: 'zulu'
319-
java-version: '8'
319+
distribution: 'temurin'
320+
java-version: ${{ env.JAVA_VERSION }}
320321
- name: Display CPU Info
321322
shell: bash
322323
run: |
@@ -397,8 +398,8 @@ jobs:
397398
run: bash .github/validate-models.sh
398399
- uses: actions/setup-java@v5
399400
with:
400-
distribution: 'zulu'
401-
java-version: '8'
401+
distribution: 'temurin'
402+
java-version: ${{ env.JAVA_VERSION }}
402403
- name: Memory before tests
403404
run: free -h
404405
- name: Enable core dumps
@@ -459,8 +460,8 @@ jobs:
459460
run: bash .github/validate-models.sh
460461
- uses: actions/setup-java@v5
461462
with:
462-
distribution: 'zulu'
463-
java-version: '8'
463+
distribution: 'temurin'
464+
java-version: ${{ env.JAVA_VERSION }}
464465
- name: Memory before tests
465466
run: vm_stat && sysctl hw.memsize hw.physmem
466467
- name: Enable core dumps
@@ -512,8 +513,8 @@ jobs:
512513
run: bash .github/validate-models.sh
513514
- uses: actions/setup-java@v5
514515
with:
515-
distribution: 'zulu'
516-
java-version: '8'
516+
distribution: 'temurin'
517+
java-version: ${{ env.JAVA_VERSION }}
517518
- name: Memory before tests
518519
run: vm_stat && sysctl hw.memsize hw.physmem
519520
- name: Enable core dumps
@@ -568,8 +569,8 @@ jobs:
568569
run: .github\validate-models.bat
569570
- uses: actions/setup-java@v5
570571
with:
571-
distribution: 'zulu'
572-
java-version: '8'
572+
distribution: 'temurin'
573+
java-version: ${{ env.JAVA_VERSION }}
573574
- name: Memory before tests
574575
run: Get-CimInstance Win32_OperatingSystem | Select-Object FreePhysicalMemory,TotalVisibleMemorySize | Format-List
575576
shell: pwsh
@@ -622,8 +623,8 @@ jobs:
622623
path: ${{ github.workspace }}/src/main/resources_linux_cuda/net/ladenthin/llama/
623624
- uses: actions/setup-java@v5
624625
with:
625-
distribution: 'zulu'
626-
java-version: '8'
626+
distribution: 'temurin'
627+
java-version: ${{ env.JAVA_VERSION }}
627628
- name: Build JARs
628629
run: mvn --batch-mode --no-transfer-progress -P release -Dmaven.test.skip=true -Dgpg.skip=true package
629630
- name: Upload JARs
@@ -641,7 +642,7 @@ jobs:
641642
steps:
642643
- uses: actions/checkout@v6
643644
- uses: actions/setup-java@v5
644-
with: { java-version: '8', distribution: zulu }
645+
with: { java-version: '${{ env.JAVA_VERSION }}', distribution: temurin }
645646
- uses: actions/download-artifact@v8
646647
with: { name: jacoco-report, path: target/site/jacoco/ }
647648
continue-on-error: true
@@ -720,8 +721,8 @@ jobs:
720721
path: snapshot-jars/
721722
- uses: actions/setup-java@v5
722723
with:
723-
java-version: '8'
724-
distribution: zulu
724+
java-version: ${{ env.JAVA_VERSION }}
725+
distribution: temurin
725726
server-id: central
726727
server-username: MAVEN_USERNAME
727728
server-password: MAVEN_PASSWORD
@@ -762,8 +763,8 @@ jobs:
762763
- name: Set up Maven Central Repository
763764
uses: actions/setup-java@v5
764765
with:
765-
java-version: '17'
766-
distribution: 'zulu'
766+
java-version: ${{ env.JAVA_VERSION }}
767+
distribution: 'temurin'
767768
server-id: central
768769
server-username: MAVEN_USERNAME
769770
server-password: MAVEN_PASSWORD

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ EXPECT_FALSE(j.contains("stop_type")); // filtered out
613613
614614
## Key Constraints
615615
616-
- **Java 11+** required.
616+
- **Java 8+** runtime required. Built with JDK 21 targeting bytecode 1.8 for broad compatibility.
617617
- Native memory allocated by llama.cpp is not GC-managed — always use `LlamaModel` in try-with-resources or call `close()` explicitly.
618618
- The `server.hpp` file is adapted from llama.cpp upstream — minimize modifications to ease future upgrades.
619619
- Platform-specific native libraries must be pre-built and placed under `src/main/resources/` before packaging for distribution.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ SPDX-License-Identifier: MIT
184184
<plugin>
185185
<groupId>org.jacoco</groupId>
186186
<artifactId>jacoco-maven-plugin</artifactId>
187-
<version>0.8.14</version>
187+
<version>0.8.15</version>
188188
<executions>
189189
<execution>
190190
<id>prepare-agent</id>

0 commit comments

Comments
 (0)