Skip to content

Caching the resolved JDK home path on once successfully resolved#1058

Merged
venmanyarun merged 2 commits intoOpenLiberty:mainfrom
sajeerzeji:GH1057-SVT_issue-Toolchain_not_honored_on_devmode_stop
Feb 19, 2026
Merged

Caching the resolved JDK home path on once successfully resolved#1058
venmanyarun merged 2 commits intoOpenLiberty:mainfrom
sajeerzeji:GH1057-SVT_issue-Toolchain_not_honored_on_devmode_stop

Conversation

@sajeerzeji
Copy link
Contributor

Fixes #1057

Root Cause: getToolchainJavaHome() returned null when dev mode stops because getJavaToolchainService().launcherFor(toolchain) is a lazy provider, resolving it requires Gradle's build operation context, which is only bound to the @TaskAction thread. The stop is triggered from DevUtil's key reader thread, which has no build operation context, causing "IllegalStateException: No current build operation" and then returns null.

Fix: Cache the resolved JDK home path on once successfully resolved. All the other calls returns the cached value directly.

Copy link
Member

@cherylking cherylking left a comment

Choose a reason for hiding this comment

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

see question

@venmanyarun venmanyarun merged commit e709b41 into OpenLiberty:main Feb 19, 2026
23 of 24 checks passed
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.

SVT: 4.0.0-SNAPSHOT reports could not determine JDK home from toolchain message when stopping the server in VSCode terminal

3 participants