I am on Debian 9 and am trying to install OpenJDK 8. When I enter the command sudo apt install openjdk-8-jre-headless
, however, I get an error saying E: Package 'openjdk-8-jre-headless' has no installation candidate
. I have installed build-essential and git, but it still does not work. Does anyone know how to fix this?
2
Answers
git has nothing to do with it. Your OS can’t find a package containing openJDK 8. Try
apt-cache openjdk-8
to see if there are any known packages containing what you need.If the
cache
command finds a package, use your favorite editor to add it to/etc/apt/sources.list
and try installing again.If
cache
cannot find what you want in a current package, search through old packages at http://snapshot.debian.org/.You can download by the following way :