镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Input property that would configure if the JDK should be configured as default or not #560

Description

@vlsi

Description:

Currently, setup-java configures the installed Java as default, however, there are cases when no change in JAVA_HOME is needed.

I suggest adding configure-as-default boolean input field (default true) so users could opt-out of configuring the installed Java for the default one.

Justification:

https://github.com/oracle-actions/setup-java downloads java binary, and it then calls actions/setup-java to set it up.

I use oracle-actions/setup-java to fetch Java EA (e.g. Java 22). I do not want Java 22 to be set as default since it would fail the build (e.g. Gradle does not yet support running with Java 22).
I need Java 22 for tests only, so I want Java 22 to be present, however, I would like to keep JAVA_HOME untouched.

Are you willing to submit a PR?

Maybe

Activity

  1. IvanZosimov commented on Nov 27, 2023

    @IvanZosimov
    Contributor

    Hi, @vlsi 👋 Thanks for the feature request! We will take a look and let you know about our decision.

  2. gsmet commented on Jan 21, 2025

    @gsmet
    Contributor

    @IvanZosimov I would be very interested in this feature too. I have been working on supporting Java for GitHub Actions for quite a while and my Java actions require a JDK but... I don't want this JDK to taint the JDK that is installed for running the job.

    Thus having the option to tell setup-java to not alter the default would be awesome.

  3. gsmet commented on Jun 15, 2026

    @gsmet
    Contributor

    I created: #1017

  4. added
    mavenMaven settings, toolchains, and publishing auth
    distributionJDK distribution/version/source support
    on Jun 22, 2026
  5. added a commit that references this issue on Jun 23, 2026
    9eb9a7c
  6. added a commit that references this issue on Jul 7, 2026
    6657b99
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

    distributionJDK distribution/version/source supportfeature requestNew feature or request to improve the current logicmavenMaven settings, toolchains, and publishing authneeds eyes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions