This article covers how to install and manage multiple Java versions on Debian 9 system. Also we described how to set default Java version and also how to uninstall Java once it is no longer needed.
Basically, the programming language Java and the Java virtual machine or JVM are used extensively and required for many kinds of software.
To install Default JRE/JDK Java on Debian.
1. First, update the package index.
$ sudo apt-get update
2. Next, install Java. Specifically, this command will install the Java Runtime Environment (JRE).
$ sudo apt-get install default-jre
When prompted, type y for yes to confirm the installation.
3. You can install the JDK with the following command:
$ sudo apt-get install default-jdk