Hey @Ali, I went through the error and there are two possible reasons for this error:
Check your internet connection, if not connected, connect it to the internet and try the same command again.
If that doesn't work, download the openjdk-8-jdk instead of the default one. Execute the following commands:
sudo apt-get upgrade
sudo apt-get update
sudo apt-get install openjdk-8-jdk