Skip to main content

JavaOptionsCli

A simple, interactive CLI tool written in Go to install and manage Java versions on Debian-based systems

Key features

Everything you need to manage Java versions efficiently

Install Java versions

Extract and install Java from tar.gz archives directly to /opt/java

Switch versions instantly

Change active Java version using update-alternatives with an interactive menu

List installed versions

View all Java versions registered in update-alternatives

Clean uninstallation

Remove Java versions from system alternatives and optionally delete files

Quick start

Get JavaOptionsCli running in minutes

1

Install JavaOptionsCli

Download or build the binary, then make it globally available:
sudo mv JavaOptionsCli /usr/bin/JavaOptionsCli
Now you can run it from anywhere.
2

Prepare your Java archive

Download a Java JDK tar.gz file and place it in a directory:
# Example: jdk-21_linux-x64_bin.tar.gz
cd ~/downloads
3

Launch the CLI

Run JavaOptionsCli from the same directory as your tar.gz file:
JavaOptionsCli
An interactive menu will appear with options to install, switch, list, or delete Java versions.
4

Install your first Java version

Select New Version Java from the menu, then enter the tar.gz filename when prompted:
Enter the name of the tar file
jdk-21_linux-x64_bin.tar.gz
The CLI will extract the archive, move it to /opt/java, and configure update-alternatives.

How it works

JavaOptionsCli integrates with Debian’s update-alternatives system

📦

Install

Extracts tar.gz archives and installs Java to /opt/java, then registers binaries with update-alternatives

Switch

Changes system-wide Java version by updating alternatives for java, javac, and jar binaries

🗑️

Manage

Lists all registered versions and provides options to remove them from alternatives or delete completely

Ready to get started?

Follow our quickstart guide to install JavaOptionsCli and manage your first Java version

View Quickstart