
The JDK is usually only needed if you are going to compile Java programs or if the software that will use Java specifically requires it. There is another default Java installation called the JDK (Java Development Kit). When prompted, type y for yes to confirm the installation. Specifically, this command will install the Java Runtime Environment (JRE).

Specifically, this will install OpenJDK 8, the latest and recommended version. The easiest option for installing Java is using the version packaged with Debian.

This tutorial provides different ways of installing Java on Debian 8: you can download the Default JRE or JDK or the Oracle JDK. The programming language Java and the Java virtual machine or JVM are used extensively and required for many kinds of software.
