2

This question already has an answer here:

I am trying to build model of apollo/apolloauto which throws this error.

I have already followed Oracle-Java8-Installer: No installation candidate

and also sudo apt-get install oracle-java8-installer which gives

$ sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
oracle-java8-installer is already the newest version (8u131-1~webupd8~2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

oracle-java8-installer is already installed then also it throws error 'oracle-java8-installer' has no installation candidate

Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'oracle-java8-installer' has no installation candidate
The command '/bin/sh -c bash /tmp/installers/install_bazel.sh' returned a non-zero code: 100

marked as duplicate by N0rbert, karel, Fabby, Kulfy, Eric Carvalho May 6 at 23:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

If you're using a newer version of Ubuntu it's because Java 8 has been replaced by a newer version. In 19.04 it's version 11. You should be able to install your release's default Java version with:

sudo apt install default-jre

I ran into a similar issue when trying to install the Minecraft deb package; it specifically looked for the version 8 of Java instead of just a Java executable with a minimum version number, so it refused to install. However, installing my default-jre brought in version 11, which works just fine with the tarball version of Minecraft that simply has a binary executable in it.

  • i have also installed latest version of java but i am trying to install 'apollo-1.5.0' which requires specifically oracle-java8-installer – Jaydeep Bhatt May 5 at 16:29
  • Java 11 should be backwards compatible with 8, so anything that requires Java 8 should run just fine with Java 11. However, if the software you're using looks for a specific version and won't run without it just because of the number attached to it, then you could always hit up the Ubuntu package repository and look for the package there, although strangely, I can't seem to find it. packages.ubuntu.com I found a similar topic, but the PPA they used has been discontinued. askubuntu.com/questions/790671/… – Gerowen May 5 at 16:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.