Software & AppsOperating SystemLinux

How To Fix “No Installation Candidate” Error When Installing Oracle Java 8 on Ubuntu Server

Ubuntu 13

In this article, we will discuss how to resolve the “No Installation Candidate” error that you may encounter when trying to install Oracle Java 8 on an Ubuntu server. This error typically arises because the oracle-java8-installer package is no longer available in the webupd8 PPA due to changes in the Oracle JDK license and the discontinuation of the PPA. However, there are alternative ways to install Oracle Java 8 on your Ubuntu Server.

Quick Answer

To fix the "No Installation Candidate" error when installing Oracle Java 8 on Ubuntu Server, you can manually install the JDK from the Oracle website or install OpenJDK 8 as an alternative. Another option is to install Oracle Java 11, following a separate guide.

Manual Installation of Oracle Java 8

One of the options to install Oracle Java 8 is to manually download and install the JDK from the Oracle website. Here are the steps to do so:

  1. Visit the Oracle Java website and download the appropriate JDK package for your system.
  2. Once downloaded, navigate to the directory where the file is downloaded and run the following command to extract the package:
tar -xvf jdk-8uXXX-linux-x64.tar.gz

Replace jdk-8uXXX-linux-x64.tar.gz with the name of the file you downloaded.

  1. Move the extracted directory to /usr/lib/jvm:
sudo mv ./jdk1.8.0_XXX/ /usr/lib/jvm/

Replace jdk1.8.0_XXX with the name of the directory you extracted.

  1. Set this as the default Java version on your system:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_XXX/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_XXX/bin/javac" 1

Replace jdk1.8.0_XXX with the name of the directory you moved.

Installing OpenJDK 8

If you do not specifically need Oracle Java 8, you can opt for OpenJDK 8, an open-source implementation of the Java platform. Here’s how to install it:

  1. Run the following command to install OpenJDK 8:
sudo apt-get install openjdk-8-jdk

This command will install OpenJDK 8 and set it as the default Java version on your system.

Installing Oracle Java 11

If you specifically need Oracle Java and not OpenJDK, you can try installing Oracle Java 11. The process is similar to Oracle Java 8. Here is a guide that provides instructions for installing Oracle Java 11 on Ubuntu 18.04.

Conclusion

While the “No Installation Candidate” error can be frustrating, it’s important to remember that it’s due to changes in Oracle’s licensing and the discontinuation of the webupd8 PPA. The solutions provided in this article should help you install Oracle Java 8 on your Ubuntu server. Always refer to official documentation and reliable sources for the most up-to-date information.

What is the reason for the “No Installation Candidate” error when installing Oracle Java 8 on Ubuntu Server?

The "No Installation Candidate" error occurs because the oracle-java8-installer package is no longer available in the webupd8 PPA due to changes in the Oracle JDK license and the discontinuation of the PPA.

How can I manually install Oracle Java 8 on Ubuntu Server?

To manually install Oracle Java 8, you can visit the Oracle Java website, download the JDK package for your system, extract the package, move the extracted directory to /usr/lib/jvm, and set it as the default Java version on your system using the update-alternatives command.

Is there an alternative to Oracle Java 8 that I can install on Ubuntu Server?

Yes, you can install OpenJDK 8, an open-source implementation of the Java platform, as an alternative to Oracle Java 8. You can install it using the sudo apt-get install openjdk-8-jdk command.

Can I install Oracle Java 11 instead of Oracle Java 8 on Ubuntu Server?

Yes, if you specifically need Oracle Java and not OpenJDK, you can try installing Oracle Java 11. The process is similar to Oracle Java 8. You can refer to a guide that provides instructions for installing Oracle Java 11 on Ubuntu 18.04.

Where can I find the official documentation for installing Oracle Java on Ubuntu Server?

You can refer to the Oracle Java website or the official Ubuntu documentation for detailed instructions on installing Oracle Java on Ubuntu Server. Additionally, the guide mentioned in this article provides instructions for installing Oracle Java 11 on Ubuntu 18.04.

Leave a Comment

Your email address will not be published. Required fields are marked *