# Temurin/Adoptium<no value>
// <!-- Required for asciidoctor -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
:toclevels: 4

[cols="1^,1^,1^",options=header]
|===
| source | condition | target
| &#10004; | &#10004; | &#10007;
|===

== Description

The `temurin` resource queries the link:https://api.adoptium.net/[Adoptium API] for link:https://adoptium.net/[Eclipse Temurin] JDK and JRE releases.

**source**::
Returns one attribute of the matching release (its version name, or a URL to the installer, checksum or signature, depending on `result`).

**condition**::
Verifies that a release exists, optionally across a set of platforms.

**target**::
Not supported - a target fails with `Target not supported for resource of kind 'temurin'`.

== Parameters

{{< resourceparameters "sources" "temurin" >}}

Every field has a default, so an empty spec is valid and resolves to the latest LTS GA JDK for `linux/x64`.

[cols="1,1,3",options=header]
|===
| Field | Default | Notes
| `releaseline` | `lts` | `lts` or `feature`.
| `releasetype` | `ga` | `ga` for general availability, `ea` for early access.
| `featureversion` | latest | The major Java version - 8, 11, 17, 21…
| `specificversion` | unset | An exact version, a JDK version, or a Temurin release name. **Takes precedence over `featureversion`**, which is then ignored.
| `architecture` | `x64` | `x86`, `aarch64`, `arm`, `ppc64`, `ppc64le`, `s390x`, `sparcv9`, `riscv64`.
| `operatingsystem` | `linux` | `windows`, `mac`, `solaris`, `aix`, `alpine-linux`.
| `imagetype` | `jdk` | `jre`, `testimage`, `debugimage`, `staticlibs`, `source`, `sbom`.
| `project` | `jdk` | `valhalla`, `metropolis`, `jfr`, `shenandoah`.
| `result` | `version` | `installer_url`, `checksum_url`, `signature_url`.
|===

`platforms` is **condition-only**. It takes `<os>/<architecture>` pairs and passes only when a release exists for all of them, the check to run before publishing something that claims multi-platform support:

[source,yaml]
----
conditions:
  available:
    kind: temurin
    spec:
      featureversion: 21
      platforms:
        - linux/x64
        - linux/aarch64
        - alpine-linux/x64
        - windows/x64
----

== Fallback when a new major is announced

Adoptium advertises the most recent feature release before its GA builds are indexed. Asked for the latest, Updatecli would then find nothing.

Instead it collects the candidate feature versions, tries the most recent first, and walks down to the next one whenever a version errors or returns no releases. The choice is only visible with `--debug`:

[source,text]
----
[temurin] no releases found for feature version 26, trying fallback
[temurin] using fallback feature version 25
----

So a source asking for the latest LTS keeps returning a usable version across the announcement window, rather than failing for a few days. Pin `featureversion` when you need a specific major regardless.

== Example

[source,yaml]
----
# updatecli.yaml
{{<include "assets/code_example/docs/plugins/resources/temurin/updatecli.d/default.yaml">}}
----

== Links

* link:https://api.adoptium.net/q/swagger-ui/[Adoptium API reference] - the authoritative list of accepted architectures and operating systems
* link:https://adoptium.net/[Eclipse Temurin]
