Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolchain cannot download JDK 18 #20344

Closed
gotson opened this issue Apr 1, 2022 · 4 comments · Fixed by #20403
Closed

Toolchain cannot download JDK 18 #20344

gotson opened this issue Apr 1, 2022 · 4 comments · Fixed by #20403
Assignees
Labels
a:bug in:toolchains Java Toolchains
Milestone

Comments

@gotson
Copy link

gotson commented Apr 1, 2022

Hello,

i have setup my project to use toolchains, but Gradle fails to download JDK 18 when running in Github Actions.
This is the error i get:

> Unable to download toolchain matching these requirements: {languageVersion=18, vendor=any, implementation=vendor-specific}
         > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
            > Could not read 'https://api.adoptopenjdk.net/v3/binary/latest/18/ga/linux/x64/jdk/hotspot/normal/adoptopenjdk' as it does not exist.

Expected Behavior

Gradle should be able to download JDK 18.

Current Behavior

Gradle fails to download JDK 18.

Context

I am trying to run tests for my project with Github Actions. Given my project will use JDK 8 and 18 to run tests via the Gradle toolchain feature, i haven't installed any JDK via Github Actions, since Gradle is supposed to be able to download them.

I also use the Gradle build action which can cache the downloaded JDK, so it makes sense to let Gradle download the necessary JDK, keeping my workflow file simpler, and letting Gradle do its magic.

Steps to Reproduce

You can check my repo which is public: https://github.com/gotson/NightMonkeys/tree/ci
Running gradle build in an environment that doesn't have an installed JDK 18 will fail.

Your Environment

gradle.build file
Github Action run that failed

@jbartok jbartok self-assigned this Apr 4, 2022
@jbartok jbartok added the in:toolchains Java Toolchains label Apr 4, 2022
@jbartok
Copy link
Member

jbartok commented Apr 4, 2022

AdoptOpenJDK & Adoptium don't seem to fully support 18 yet, we're going to investigate.

@yogurtearl
Copy link
Contributor

yogurtearl commented Apr 4, 2022

Adoptium DOES support JDK 18:
download is available here: https://api.adoptium.net/v3/binary/latest/18/ga/linux/x64/jdk/hotspot/normal/eclipse

But looks like AdoptOpenJDK does NOT have JDK 18:
neither of these work for 18:
https://api.adoptopenjdk.net/v3/binary/latest/18/ga/linux/x64/jdk/hotspot/normal/adoptopenjdk
https://api.adoptopenjdk.net/v3/binary/latest/18/ga/linux/x64/jdk/hotspot/normal/eclipse

Although, this is misleading:
https://api.adoptopenjdk.net/v3/info/available_releases

{
    "available_lts_releases": [
        8,
        11,
        17
    ],
    "available_releases": [
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18
    ],
    "most_recent_feature_release": 18,
    "most_recent_feature_version": 18,
    "most_recent_lts": 17,
    "tip_version": 19
}

@octylFractal
Copy link
Member

octylFractal commented Apr 5, 2022

In my opinion, we should change to using the Adoptium APIs for everything that we can (8, 11, 17, 18+) and only use AdoptOpenJDK APIs for builds that need it (non-LTS <18). This should be a compatible change.

Also note, this is blocking #20276

@yogurtearl
Copy link
Contributor

would probably need to add another property for an adoptium alternate base URI in addition to the adoptopenjdk base uri?

e.g.

org.gradle.jvm.toolchain.install.adoptopenjdk.baseUri=https://mycorp.com/adoptopenjdk/api
org.gradle.jvm.toolchain.install.adoptium.baseUri=https://mycorp.com/adoptium/api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug in:toolchains Java Toolchains
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants