Skip to content
Latchkey

GitHub Actions setup-java "Could not find satisfied version"

actions/setup-java could not provide the requested JDK because the chosen distribution does not ship that version for the runner, or the required distribution input was omitted.

What this error means

The Setup Java step fails with "Could not find satisfied version for SemVer", or errors that the distribution input is required and missing.

Actions log
Error: Could not find satisfied version for SemVer '21'.
# the selected distribution has no 21 build for this runner, or
Error: Input required and not supplied: distribution

Common causes

Distribution lacks the requested version

Each distribution (temurin, zulu, corretto, liberica) ships a specific set of JDK versions per OS/arch. Requesting a version that distribution does not provide fails resolution.

Missing distribution input

setup-java@v4 requires distribution. Omitting it fails because there is no default distribution.

How to fix it

Set a distribution that has the version

Specify both distribution and java-version, choosing a distribution that ships the JDK you need.

.github/workflows/ci.yml
- uses: actions/setup-java@v4
  with:
    distribution: temurin
    java-version: '21'

Pick an available version/arch combination

  1. Confirm the distribution publishes the version for the runner OS and architecture.
  2. Try an alternate distribution (zulu, corretto) if temurin lacks the build.
  3. Re-run if the JDK download itself failed transiently.

How to prevent it

  • Always set the distribution input for setup-java.
  • Verify the distribution ships your JDK version for the runner arch.
  • Pin to an LTS JDK that all distributions provide.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →