https://developer.sony.com/develop/open-devices/guides/aosp-build-instructions/build-aosp-nougat-marshmallow-6-0-1
Run the following:
sudo apt-get update sudo apt-get install openjdk-8-jdk
sudo apt-get update
sudo apt-get install openjdk-8-jdk