Skip to content

Handle tools requiring unresolved system modules - #93

Merged
DanielThomas merged 1 commit into
mainfrom
fix/install-jdk-modules
Oct 22, 2026
Merged

DanielThomas merged 1 commit into
mainfrom
fix/install-jdk-modules

Conversation

@DanielThomas

Copy link
Copy Markdown
Member

Summary

Fix installation and dynamic tool discovery when an application requires system modules that are present in the JDK but absent from ja's hosting layer, as reported in #90.

  • Inspect the module descriptor before attempting provider discovery, so installing a main-class application does not load its classes unnecessarily.
  • Make system modules observable during resolution while preserving the existing parent/path selection policy.
  • Detect newly resolved system modules before defining a child layer. Reuse the existing Java launcher, option-inspection entry point, and tool dispatcher to discover and run those providers in a child JVM, where startup assigns system modules to the correct built-in loaders.
  • Keep system-installed tools and dynamically discovered tools whose dependencies are already loaded on the existing in-process path. No unconditional java.se/ALL-SYSTEM startup roots or JDK-internal APIs.
  • Preserve provider option discovery, runtime-access arguments, source overrides, and warmup metadata across the fallback.

Validation

  • Added regressions covering java.sql, java.se, and jdk.xml.dom, both ToolProvider and javax.tools.Tool, activated providers, source overrides, and warmup metadata.
  • Real install-and-run tests distinguish provider dispatch from main-class dispatch and assert that installed commands do not fork an additional JVM.
  • Explicitly assert that running the system-installed jig does not invoke the Java launcher, and compare process IDs for dynamic tools with and without additional system-module requirements.
  • ja test --all: 490/491 passing. The only failure is the pre-existing JmhToolProviderTest.discoversAndRunsAModularBenchmark, whose server-socket bind is denied by the sandbox (SocketException: Operation not permitted).
  • After adding the installed-command process-ID assertions: ja test --all com.netflix.tools.ja.test.InstallerTest: 22/22 passing.
  • The original SQL provider reproduction succeeds through the current-source CLI for tool execution, installation, and execution of the installed command.
  • git diff --check passes.

@DanielThomas
DanielThomas merged commit 154bde6 into main Oct 22, 2026
12 checks passed
@DanielThomas DanielThomas mentioned this pull request Oct 22, 2026
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.

1 participant