Skip to content

[Java] - Feature fix - #1713

Open
Kaniska (Kaniska244) wants to merge 4 commits into
devcontainers:mainfrom
Kaniska244:app-token-test
Open

[Java] - Feature fix #1713
Kaniska (Kaniska244) wants to merge 4 commits into
devcontainers:mainfrom
Kaniska244:app-token-test

Conversation

@Kaniska244

@Kaniska244 Kaniska (Kaniska244) commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes Java 25 installation through SDKMAN using the default Microsoft JDK distribution.

SDKMAN publishes Java 25 candidates with build metadata, such as 25.0.4+1-ms. The existing regex only accepted dot-prefixed qualifiers, causing Java 25 candidates containing +1 to be excluded from the available version list.

Changes

  • Updated Java candidate matching from (\.[a-z0-9]+)*- to ([.+][a-z0-9]+)*-.
  • Added support for SDKMAN candidate identifiers containing build metadata such as 25.0.4+1-ms.
  • Applied the fix to both primary Java installations and additionalVersions.
  • Added a dedicated Java 25 test scenario on Ubuntu Noble.
  • Added tests for Java 25 compilation, execution, default version selection, and Microsoft candidate detection.
  • Added Java 25 to the additional versions test while preserving Java 11 as the default.
  • Bumped the Java Feature version from 1.8.1 to 1.8.2.

Testing

The new install_java_25 scenario verifies:

  • Java 25 is installed as the default version.
  • Java 25 can compile and execute a Java program.
  • The installed SDKMAN candidate matches the expected 25.x+build-ms format.

The updated install_additional_java scenario verifies:

  • Java 25 can be installed through additionalVersions.
  • Java 11 remains the default version.
  • Existing Java 17 and Java 8 installations continue to work.

Related to #1308.

@Kaniska244
Kaniska (Kaniska244) marked this pull request as ready for review August 24, 2026 18:05
@Kaniska244
Kaniska (Kaniska244) requested a review from a team as a code owner August 24, 2026 18:05
@Kaniska244
Kaniska (Kaniska244) requested a lite review from Copilot August 24, 2026 18:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Java 25 installation via SDKMAN by widening the SDKMAN candidate-matching regex to include build metadata segments (e.g. 25.0.4+1-ms), and adds test coverage to ensure Java 25 installs and runs correctly.

Changes:

  • Updated the Java SDKMAN version extraction regex to accept both . and + qualifier/build-metadata segments.
  • Applied the regex fix for both the primary Java version and additionalVersions.
  • Added a dedicated Java 25 scenario plus updated additional-versions coverage, and bumped the feature version.
Show a summary per file
File Description
test/java/scenarios.json Adds a Java 25 scenario and includes Java 25 in the additional versions scenario.
test/java/install_java_25.sh New scenario test validating Java 25 install, compile/run, and candidate naming format.
test/java/install_additional_java.sh Extends additional-versions scenario assertions to include Java 25.
src/java/install.sh Updates SDKMAN Java candidate-matching regex to include + build metadata.
src/java/devcontainer-feature.json Bumps the Java feature version from 1.8.1 to 1.8.2.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/java/install.sh
fi

sdk_install java ${JAVA_VERSION} "\\s*" "(\\.[a-z0-9]+)*-" ".*-[a-z]+$" "true"
sdk_install java ${JAVA_VERSION} "\\s*" "([.+][a-z0-9]+)*-" ".*-[a-z]+$" "true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants