From 70603efa3671444a3c48a2f81bbd7596a558636c Mon Sep 17 00:00:00 2001 From: Sampo Kuokkanen Date: Thu, 20 Aug 2026 21:26:19 +0900 Subject: [PATCH] Set up Java 21 for JRuby. JRuby is compiled for Java 21, but the runner provides Java 17 by default, so it fails to start before any tests run: UnsupportedClassVersionError: org/jruby/main/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0 --- template/actions/.github/workflows/test.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/template/actions/.github/workflows/test.yaml b/template/actions/.github/workflows/test.yaml index 32501fa0..c733864d 100644 --- a/template/actions/.github/workflows/test.yaml +++ b/template/actions/.github/workflows/test.yaml @@ -37,6 +37,14 @@ jobs: steps: - uses: actions/checkout@v7 + + # JRuby requires a more recent JDK than the runner provides by default: + - uses: actions/setup-java@v4 + if: startsWith(matrix.ruby, 'jruby') + with: + distribution: temurin + java-version: "21" + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}}