Skip to content

JVM

Coursier can act as a JVM manager like SDKMAN or asdf.

One notable feature of it is that it can give you the Java home of a JDK distribution without actually "installing" it or "setting it up" on your system, but only relying on the various coursier caches. That allows to manage several JDKs in parallel, with users using a main default JDK, but using another one in a particular shell session, while apps can use some other JDKs.

The JVM management features of coursier rely on its JVM index. This index is updated on a regular basis, and list JDKs from various vendors, such as Temurin, GraalVM, Zulu, Liberica, etc. See here for a more up-to-date list.

The coursier JVM index is published both on GitHub and on Maven Central. Both the API and the CLI of coursier default to the index on GitHub.

In more detail, when asked for a JVM, coursier first downloads a JVM index. It then look for an entry in it adapted to the current OS and CPU architecture, and satisfying the user's request. It then uses the archive cache of coursier to get an extracted version of that archive on disk. The archive cache itself downloads the archive if needed with the standard coursier cache, and extracts it under its own cache directory.

So the JVMs live under the archive cache directory.