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.
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: distributionCommon 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.
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'Pick an available version/arch combination
- Confirm the distribution publishes the version for the runner OS and architecture.
- Try an alternate distribution (zulu, corretto) if temurin lacks the build.
- 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.