Use JDKs you already have
Discovered JDKs
javm finds JDKs installed by the system, IntelliJ IDEA, Gradle, and jabba, and lists them next to the ones it installed:
javm ls # JDKs and the selectors that pick them
javm ls --details # source, vendor, architecture, and path
javm discover refresh # rescan after installing or removing a JDK outside javm
Discovery results are cached for 24 hours. The sources and the cache duration are configured in
JAVM_HOME/autodiscover/config.json.
Link a JDK installed elsewhere
For a JDK that discovery does not find, register it under a system@ name with an exact version:
javm link system@21.0.1 /path/to/jdk # register
javm link system@21.0.1 # show the target
javm use system@21 # select it with any matching selector
javm unlink system@21.0.1 # remove the registration
The path must be the JDK root, containing bin/java on Linux, Contents/Home/bin/java on macOS (pass the bundle
root, not Contents/Home), or bin\java.exe on Windows. To change the path of a link, unlink it and link again.
Managed vs linked JDKs
| Managed | Linked or discovered | |
|---|---|---|
| Created by | javm install | Another installer, then javm link or discovery |
| Stored in | JAVM_HOME/jdk | Its original location |
| Removed with | javm uninstall | javm unlink removes only the link; the JDK stays |
Updated by javm update | Yes | No |