see if you have any java installled
java -version
sudo apt install openjdk-14-jdk
then you need to select which java to use, in case you have multiple installations on your system
sudo update-alternatives --config java
export JAVA_HOME=/usr/lib/jvm/java-14-openjdk-amd64
echo $JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin
echo $PATH
to make it persistent after reboot, add the code to:
vim /etc/environment
JAVA_HOME="/usr/lib/jvm/java-14-openjdk-amd64"
source /etc/environment