Skip to content

Add support for downloading and running JDK builds #612

Description

@BlueGoliath

Description:
Add an option to set a URL for a JDK build which setup-java will use to download, uncompress, and run per arch.

Justification:
I often use unreleased Java versions not supported by this plugin(e.g. Java 22) and would like to use it.

Activity

  1. v-HarithaVattikuti commented on Mar 27, 2024

    @v-HarithaVattikuti
    Contributor

    Hello @BlueGoliath
    Thank you for creating this feature request. We will investigate it and get back to you as soon as we have some feedback.

  2. brunoborges commented on Jun 5, 2024

    @brunoborges
    Contributor

    @HarithaVattikuti any update on this issue? It would potentially address other needs as well.

  3. brunoborges commented on Jun 23, 2026

    @brunoborges
    Contributor

    This use case is already supported today via the jdkfile distribution, without needing a dedicated URL input.

    You can download the JDK in a prior step and point setup-java at the archive with the jdkFile input — setup-java then handles extraction, installation, caching, and JAVA_HOME setup:

    steps:
    - run: |
        download_url="https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_linux_hotspot_22_36.tar.gz"
        wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
    - uses: actions/setup-java@v5
      with:
        distribution: 'jdkfile'
        jdkFile: ${{ runner.temp }}/java_package.tar.gz
        java-version: '22'
        architecture: x64
    - run: java --version

    This is exactly the scenario you described — using unreleased / Early Access Java versions not yet provided by setup-java. The only difference from the original request is that the download happens in a workflow step (a single wget/curl line) rather than setup-java fetching the URL itself, which also gives you full control over architecture selection.

    This is documented in Installing Java from local file, which also shows a variant that auto-fetches the latest JDK at runtime.

    Given the need is fully met by the existing jdkfile feature, I'm closing this issue. I'll also add a note to the advanced docs calling out the Early Access use case explicitly. If you'd prefer a native jdkUrl input where setup-java does the download itself, feel free to open a separate feature request for that specific enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationfeature requestNew feature or request to improve the current logic

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions