Installing OpenJDK 8 on Debian-based Systems

Steps for installing OpenJDK 8 on Debian-based systems.

Configure your operating system to use the latest build of a Technology Compatibility Kit (TCK) Certified OpenJDK version 8. For example, OpenJDK 8 (1.8.0_151 minimum).
Tip: Although Oracle JRE/JDK 8 is supported, DataStax does more extensive testing on OpenJDK 8. This change is due to the end of public updates for Oracle JRE/JDK 8.
Java 9 is not supported.

In a terminal:
  1. Download and update the repositories:
    sudo apt-get update
  2. Install OpenJDK 8:
    sudo apt-get install openjdk-8-jdk
  3. If you have more than one Java version installed on your system use the following command to switch versions:
    sudo update-alternatives --config java
  4. Make sure your system is using the correct JDK:
    java -version
    openjdk version "1.8.0_171"
    OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11)
    OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)