skip to Main Content

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


  1. 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 cachecommand 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/.

    Login or Signup to reply.
  2. You can download by the following way :

    sudo add-apt-repository ppa:openjdk-r/ppa
    
    sudo apt-get update
    
    sudo apt-get install openjdk-8-jre
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search