Add an error condition for an unstable Microsoft OpenJDK build by dmitry-shibanov · Pull Request #263 · actions/setup-java (original) (raw)

Conversation

@dmitry-shibanov

Description:
In scope of this pull request we add condition to throw an error for an unstable Microsoft OpenJDK build. Some distributions support early access versions with syntax 11-ea. For now Microsoft OpenJDK does not provide ea versions. The action will not throw an error if user tries to install ea version for Microsoft OpenJDK

Related issue:

Check list:

@dmitry-shibanov

MaksimZhukov

@dmitry-shibanov

brcrista

}
if (!this.stable) {
throw new Error('Unstable versions are not supported');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the value of adding a special error message here? We only have two hardcoded versions currently. If someone requests something that's not one of those versions, we'll raise an error and show the available versions (lines 62-70 of this file).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get ga/ea versions of java releases, but Microsoft OpenJDK builds do not have ea versions. If we pass 11-ea in java-version input, the action won't throw an error and install stable version, because the action normalizes version to 11 and set stable to the false value. For now I think we should write a condition to throw an error for ea builds.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw new Error('Unstable versions are not supported');
throw new Error('Early access versions are not supported');

While it's true that it's not a stable version, "unstable" has a stronger denotation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thank you.

@dmitry-shibanov

brcrista

tdfacer pushed a commit to ifit/setup-java that referenced this pull request

Oct 7, 2025

@dmitry-shibanov

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})