Skip to main content

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.

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​

ManagedLinked or discovered
Created byjavm installAnother installer, then javm link or discovery
Stored inJAVM_HOME/jdkIts original location
Removed withjavm uninstalljavm unlink removes only the link; the JDK stays
Updated by javm updateYesNo