Install Java on Ubuntu 16.04
- Install the OpenJDK 8 from a PPA repository
$ sudo add-apt-repository ppa:openjdk-r/ppa
- Update the system package cache and install
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk
- If you have more than one Java version installed on your system use the following command to switch versions
$ sudo update-alternatives --config java
- Make sure your system is using the correct JDK
Reference
https://docs.datastax.com/en/cassandra/3.0/cassandra/install/installOpenJdkDeb.html