Skip to content

feat: add Detect hook, so that vfox link --detect java finds existing JDKs - #128

Merged
linghengqian merged 1 commit into
mainfrom
feat/detect-hook
Nov 10, 2026
Merged

linghengqian merged 1 commit into
mainfrom
feat/detect-hook

Conversation

@linghengqian

@linghengqian linghengqian commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Fixes #127, fixes #126, part of version-fox/vfox#737.

Detect: scans Gradle's jdks folder, IntelliJ IDEA's folder, system directories (/usr/lib/jvm, Program Files), version managers (SDKMAN, asdf, mise, jabba), Homebrew kegs (incl. Linuxbrew), Scoop apps, the CI runner tool cache and JAVA_HOME. winget/Chocolatey/vendor installers land in Program Files and are covered by the same roots; nvm manages Node.js only.

Reads each candidate's release file and names the version like install does: runtime version (SEMANTIC_VERSION or leading release+build), GraalVM's own version for that family, then -short name from IMPLEMENTOR and -fx for JavaFX, no suffix for OpenJDK.

Opt-in IDEA links: with VFOX_JAVA_JDKS_LINKS=1 set, each install leaves a link named after the version in IDEA's folder (~/.jdks, ~/Library/Java/JavaVirtualMachines on macOS, %USERPROFILE%.jdks on Windows) so Gradle and IntelliJ IDEA find it; vfox uninstall removes the link it created. Non-links are never touched, failures only warn.

Includes offline tests in the vfox.test style plus real-shell layout tests, and user docs (README, new docs/link.md, troubleshooting pointer, changes.md Unreleased entries). Bumps the Test Plugin workflow to vfox 1.1.0, which brings the Detect hook.

@linghengqian
linghengqian force-pushed the feat/detect-hook branch 3 times, most recently from 85e4555 to ef90a3f Compare November 10, 2026 03:54
Fixes #127 (Detect hook for vfox link --detect)
and #126 (opt-in links in ~/.jdks), part of
version-fox/vfox#737.

Detect scans Gradle's jdks folder, IntelliJ IDEA's folder, system
directories, SDKMAN/asdf/mise/jabba, Homebrew kegs, Scoop apps, the CI
runner tool cache and JAVA_HOME, naming versions like install does.
With VFOX_JAVA_JDKS_LINKS=1, each install leaves a version-named link in
IDEA's folder and uninstall removes it; non-links are never touched.
@linghengqian linghengqian added the enhancement New feature or request label Nov 10, 2026
@linghengqian
linghengqian merged commit b346ad9 into main Nov 10, 2026
14 of 15 checks passed
@linghengqian
linghengqian deleted the feat/detect-hook branch November 10, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

1 participant