GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow to install multiple JDK distributions · Issue #945 · actions/setup-java

Allow to install multiple JDK distributions #945

New issue
Copy link
New issue
Copy link
Closed as not planned
Feature
Closed as not planned
Allow to install multiple JDK distributions#945
Feature
Copy link
Labels
feature requestNew feature or request to improve the current logicwaiting-for-response

Description

@pjBooms
pjBooms
opened on Oct 20, 2025
Issue body actions

Description:
The documentation says how to install multiple JDK versions. It would be nice to add ability to install multiple JDK distributions as well.

Justification:
Some of our tests require a specific JDK distribution while other are able to work with any JDK. Now we have to install that specific JDK, while it would be better for us to run other tests on more commonly used JDK.

Are you willing to submit a PR?
No

Activity

  1. pjBooms
    added
    feature requestNew feature or request to improve the current logic
    needs triage
    on Oct 20, 2025
  2. v-priya-kinthali
    removed
    needs triage
    on Oct 21, 2025
  3. v-priya-kinthali commented on Oct 21, 2025

    @v-priya-kinthali
    v-priya-kinthali
    on Oct 21, 2025
    Contributor
    More actions

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

  4. mhoffrog commented on Nov 23, 2025

    @mhoffrog
    mhoffrog
    on Nov 23, 2025
    Contributor
    More actions

    @priya-kinthali @pjBooms This feature looks same as issue #552 and it is met when PR #553 would be merged. I am using it for the purpose to install multiple JDK versions. Only the first JDK install is updating settings.xml. Any subsequent additional JDK installation will add those additional JDKs to the toolchains.xml only and will not touch the settings.xml.

  5. brunoborges
    added
    distributionJDK distribution/version/source support
    on Jun 22, 2026
  6. brunoborges commented on Jun 23, 2026

    @brunoborges
    brunoborges
    on Jun 23, 2026
    Contributor
    More actions

    Tracked under the epic #1049 (install multiple JDK distributions in one step). This issue stays open as a specific sub-request/approach.

  7. brunoborges
    added the
    Feature
    issue type on Jun 23, 2026
  8. brunoborges commented on Jul 9, 2026

    @brunoborges
    brunoborges
    on Jul 9, 2026
    Contributor
    More actions

    Hi @pjBooms 👋 — we're scoping how setup-java should install multiple distributions. Before we finalize the input design, we'd like your take on the intended semantics.

    Say you configure two distributions (e.g. temurin, zulu) and three versions (11, 17, 21). Which behavior matches your use case?

    1. Index pairing (1:1): distributions and versions are zipped by position → temurin-11, zulu-17, and version 21 would need a matching distribution (error if lengths differ). Installs N JDKs.
    2. Cross-product (matrix): every distribution × every version → 6 JDKs (temurin-{11,17,21} + zulu-{11,17,21}).
    3. Explicit per-line mapping: each line names both, e.g.
      java: |
        temurin@21
        zulu@17
      No implicit multiplication — you list exactly the JDKs you want.

    Your original ask was "some tests need a specific distro, others any" — option 3 (or 1) seems to fit that, but we want to confirm before building. Which would you expect, and which should become the default JAVA_HOME?

    /cc @mhoffrog

  9. brunoborges
    added
    waiting-for-response
    and removed
    distributionJDK distribution/version/source support
    on Jul 9, 2026
  10. brunoborges commented on Jul 14, 2026

    @brunoborges
    brunoborges
    on Jul 14, 2026
    Contributor
    More actions

    Thanks for the request, @pjBooms 👋

    After scoping this against the existing capabilities, we've decided not to add a dedicated multi-distribution input, because both of your use cases are already covered today.

    1. Testing against different vendors → use a matrix (separate jobs)

    This gives you clean isolation, parallelism, and clear failure attribution per vendor:

    jobs:
      test:
        strategy:
          matrix:
            distribution: [temurin, zulu]
            java-version: [17, 21]
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-java@v5
            with:
              distribution: ${{ matrix.distribution }}
              java-version: ${{ matrix.java-version }}
          - run: ./mvnw test

    2. Multiple distributions available in a single job → stack setup-java steps

    This directly matches your justification ("some tests need a specific distro, others run on any JDK"). Each additional setup-java call appends the JDK to toolchains.xml without touching the previously written settings.xml, and the last step installed becomes the default JAVA_HOME:

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v5
        with:
          distribution: temurin      # common default -> JAVA_HOME
          java-version: 21
      - uses: actions/setup-java@v5
        with:
          distribution: graalvm      # extra distro, added to toolchains.xml
          java-version: 21
      - run: ./mvnw verify           # Maven can select either via <toolchains>

    Maven/Gradle then pick the right JDK per module/test via toolchains, while tests that work on "any JDK" just use the default. See Install multiple JDKs and Using Maven Toolchains.

    Because a first-class multi-distribution input would introduce ambiguous semantics (index-pairing vs. cross-product vs. explicit mapping, plus which JDK owns JAVA_HOME) for marginal ergonomic gain over the patterns above, we're closing this as not planned. If you hit a concrete scenario that neither pattern above can express, please comment and we'll happily reopen.

  11. brunoborges
    closed this as not plannedon Jul 14, 2026
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

    feature requestNew feature or request to improve the current logicwaiting-for-response

    Type

    Feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.