update-alternatives under the hood to seamlessly switch between different Java installations.
Available commands
When you launch JavaOptionsCli, you’ll see an interactive menu with the following options:New version Java
Install and register a new Java version from a tar file
Change version
Switch between installed Java versions
View list versions
Display all registered Java versions in the system
Delete version
Remove a Java version from system alternatives
Update list
Automatically select the highest priority Java version
How the menu works
The interactive menu is implemented ininternal/menu.go:11-41 and uses the pterm library for rendering:
Navigation
Use arrow keys to navigate through the menu options and press Enter to select a command. Choose “Exit” to close the application.Behind the scenes
All commands interact with Linux’supdate-alternatives system, which manages symbolic links for commands that can have multiple versions installed. JavaOptionsCli manages three key Java binaries:
java- The Java runtimejavac- The Java compilerjar- The Java archive tool
All Java installations are stored in
/opt/java/ by default. Make sure this directory exists before installing new versions.