CI: Gradle build fails — JDK not available in runner container #16

Closed
opened 2026-05-14 05:34:40 +00:00 by Mark · 1 comment
Owner

CI: Gradle build fails — JDK not available in runner container

Symptom

The CI workflow ci.yml fails at the Gradle build step. The runner's base container (node:20-bookworm) has no JDK installed, so ./gradlew build fails with "java: command not found".

Steps to reproduce

  1. Push to main on Mark/mc-heroes-mod
  2. CI triggers ci.yml workflow
  3. actions/checkout@v4 succeeds
  4. actions/setup-java@v4 fails or Gradle can't find Java

Root cause

The workflow uses runs-on: ubuntu-latest which maps to docker://node:20-bookworm — a Node.js container with no JDK. The actions/setup-java@v4 action has compatibility issues with Forgejo's act_runner in container mode.

Suggested fix

Change the workflow to use a JDK-containing container:

jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: eclipse-temurin:21-jdk
    steps:
      - uses: actions/checkout@v4
      # ... rest stays the same

This repo has been re-dispatched after removing redundant setup-python — the Gradle failure will persist until the JDK issue is fixed.

## CI: Gradle build fails — JDK not available in runner container ### Symptom The CI workflow `ci.yml` fails at the Gradle build step. The runner's base container (`node:20-bookworm`) has no JDK installed, so `./gradlew build` fails with "java: command not found". ### Steps to reproduce 1. Push to main on Mark/mc-heroes-mod 2. CI triggers `ci.yml` workflow 3. `actions/checkout@v4` succeeds 4. `actions/setup-java@v4` fails or Gradle can't find Java ### Root cause The workflow uses `runs-on: ubuntu-latest` which maps to `docker://node:20-bookworm` — a Node.js container with no JDK. The `actions/setup-java@v4` action has compatibility issues with Forgejo's act_runner in container mode. ### Suggested fix Change the workflow to use a JDK-containing container: ```yaml jobs: build: runs-on: ubuntu-latest container: image: eclipse-temurin:21-jdk steps: - uses: actions/checkout@v4 # ... rest stays the same ``` This repo has been re-dispatched after removing redundant `setup-python` — the Gradle failure will persist until the JDK issue is fixed.
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-14 09:30:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mc-heroes-mod#16
No description provided.