1

I am running Ubuntu Server 18.04 and want to install opendjdk-8-jdk. I have tried doing these steps (referring to this).

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

But I am still getting this:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package openjdk-8-jdk

I specifically want openJDK rather than Oracle-Java-Kit that some repositories offer.

Thank you.

Zanna
  • 69,223
  • 56
  • 216
  • 327
Jay Patel
  • 13
  • 1
  • 1
  • 3
  • The package name is `openjdk-8`. There's no package named `openjdk-8-jdk`in that repo. –  Nov 12 '18 at 01:33
  • @GabrielaGarcia tried that too. No luck. – Jay Patel Nov 12 '18 at 01:37
  • I think I just found the reason. Itś for older releases only. You need `openjdk-11` for Ubuntu 18.04. But the guide is wrong anyway. –  Nov 12 '18 at 01:44
  • Possible duplicate of [How do I enable the "Universe" repository?](https://askubuntu.com/questions/148638/how-do-i-enable-the-universe-repository) – N0rbert Nov 12 '18 at 20:14

1 Answers1

2

I suggest you remove the ppa and enable the universe repo instead.

apt policy openjdk-8-jdk
openjdk-8-jdk:
  Installed: (none)
  Candidate: 8u181-b13-1ubuntu0.18.04.1
  Version table:
     8u181-b13-1ubuntu0.18.04.1 500
        500 [my local mirror]/mirror/us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
        500 [my local mirror]/mirror/us.archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
     8u162-b12-1 500
        500 [my local mirror]/mirror/us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Organic Marble
  • 22,803
  • 12
  • 65
  • 118
  • 3
    Thanks. It worked. Found how to enable the universe repo here: https://askubuntu.com/questions/78613/how-do-i-enable-the-universe-repository-from-the-command-line – Jay Patel Nov 12 '18 at 01:51