Skip to content

Support for path /opt/hostedtoolcache for JDKs #2352

@koppor

Description

@koppor

I use GitHub actions. I have

      - name: Set up JDK
        uses: actions/setup-java@v5
        with:
          java-version: 24
          distribution: 'corretto'
          check-latest: true
      - name: Set up JDK
        uses: actions/setup-java@v5
        with:
          java-version: 25
          distribution: 'corretto'
          check-latest: true

GitHub actions says:

   Java configuration:
    Distribution: corretto
    Version: 24.0.2+12.1
    Path: /opt/hostedtoolcache/Java_Corretto_jdk/24.0.2-12.1/x64
...

  Java configuration:
    Distribution: corretto
    Version: 25.0.1+9.1
    Path: /opt/hostedtoolcache/Java_Corretto_jdk/25.0.1-9.1/x64

Moreover, I get

Error:  [ERROR] No suitable JDK was found for requested version: 24
[jbang] Run with --verbose for more details. The --verbose must be placed before the jbang command. I.e. jbang --verbose run [...]

I don't understand - because JDK24 is available at /opt/hostedtoolcache/Java_Corretto_jdk/25.0.1-9.1/x64.

I need JDK 25 because of OpenRewrite and my JBang scripts have requirement on JDK24. (I changed the latter, but I wanted to raise this issue nevertheless)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions