jenv

manages multiple Java JDK installations and sets JAVA_HOME automatically

TLDR

Add a JDK
$ jenv add [/path/to/java/home]
List installed versions
$ jenv versions
Show current version
$ jenv version
Set global Java version
$ jenv global [11.0.20]
Set local version for directory
$ jenv local [17.0.1]
Set version for current shell
$ jenv shell [11.0.20]
Enable a plugin
$ jenv enable-plugin [export]
Check configuration
$ jenv doctor

SYNOPSIS

jenv command [arguments]

DESCRIPTION

jenv manages multiple Java JDK installations and sets JAVAHOME automatically. It does not install JDKs itself. Version priority: shell > local > global. Use the **export** plugin for JAVAHOME support. Creates .java-version files for local versions.

SUBCOMMANDS

add path

Add a JDK installation.
versions
List available versions.
version
Show current active version.
global version
Set global default version.
local version
Set directory-specific version.
shell version
Set version for current shell.
enable-plugin name
Enable a plugin.
disable-plugin name
Disable a plugin.
doctor
Verify configuration.

INSTALL

sudo pacman -S jenv
brew install jenv

SEE ALSO

java(1)