GeezerVison is showing github.com — Parse Java distribution from .sdkmanrc · Issue #971 · actions/setup-java
Parse Java distribution from .sdkmanrc #971DescriptionDescription:
Given that the action now supports reading the Java version from the .sdkmanrc file, it would be advantageous to read a default distribution from that file as well. SDKMan uses distinct suffixes for each distribution to simplify mapping.
Justification:
Removes the need for users to duplicate the distribution information into their workflow.
Are you willing to submit a PR?
Maybe? Depends on the level of effort :) Reacted by 이정렬(AWS), Lukasz, nyo, Pedro Freitas, Oliver Behncke and Travis Wyatt Reacted by nyo and Kim A. Betti Activityv-aparnajyothi-y commented on Jan 19, 2026 Hello @mlschechter, Thank you for creating this issue and we will get back to you once we have some feedback on this :) lukaszgyg commented on Jan 24, 2026 I've implemented this feature in PR #975.
Why This Feature Matters
When using .sdkmanrc, the distribution information is already present in the file format itself (e.g., java=21.0.5-tem where tem indicates Temurin). Currently, users must redundantly specify this in their workflow:
Current requirement (redundant):
- uses: actions/setup-java@main
with:
distribution: temurin # Duplicates information from .sdkmanrc
java-version-file: .sdkmanrc
.sdkmanrc already contains:
java=21.0.5-tem # "tem" already indicates Temurin
Value Proposition
- Eliminates Redundancy: The distribution parameter becomes unnecessary when
.sdkmanrc already specifies it
- Single Source of Truth: Java configuration lives entirely in
.sdkmanrc
- Consistency: Local development (SDKMAN) and CI/CD use identical configuration
- Simplified Workflows: One less parameter to maintain and keep in sync
With this feature:
- uses: actions/setup-java@main
with:
java-version-file: .sdkmanrc # That's it!
The implementation is backward compatible - if .sdkmanrc doesn't include a distribution suffix, the distribution parameter is still required. Reacted by 이정렬(AWS), nyo and Oliver Behncke Reacted by nyo lukaszgyg commented on Mar 24, 2026 Implemented in PR #975. The PR now parses supported SDKMAN distribution suffixes from .sdkmanrc, including the mapping fixes and test coverage discussed in review. Reacted by Michael Schechter Reacted by Michael Schechter michael-schechter-simspace commented on Jun 10, 2026 @lukaszgyg - Thanks for the implementation; is there any information on when this will be merged and released? lukaszgyg commented on Jun 10, 2026 Unfortunately no :-(
@aparnajyothi-y how we can trigger the review process for #975 brunoborges commented on Jun 23, 2026 Linking implementation: this is being addressed by PR #975 (distribution detection from .sdkmanrc). Tracking it there — this issue should auto-close when #975 merges. brunoborges commented on Jun 23, 2026 Tracked under the epic #1048 (infer Java version/distribution from project files), which groups the related file-based detection requests for consistent design. This issue stays open as the specific sub-request.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|