Unable to locate package oracle-java8-installer

1

I'm simply trying to install the oracle-java8-installer package in order to install JAVA 8 on my debian server.

No idea why, I get the following output:

root@vps:~# sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package oracle-java8-installer

Any idea what could have gone wrong?

TheUnreal

Posted 2019-06-15T09:22:09.870

Reputation: 137

Answers

1

You have two alternatives:

  1. Manually download the .tar.gz file for Oracle Java SE Development Kit 8 from the official Oracle website, and compile it by following the instructions in How do I install a .tar.gz (or .tar.bz2) file?.

  2. Install Java 7 from the default Debian jessie repositories.

    sudo apt-get install openjdk-7-jdk
    

The default Java JDK package is openjdk-8-jdk in Debian stretch and openjdk-11-jdk in buster.

Oracle is no longer maintaining OpenJDK 8 and OpenJDK 11. Red Hat is providing bug fixes and security patches for OpenJDK 8 and OpenJDK 11, taking over from Oracle. If you are using OpenJDK from the default Debian repositories, Oracle's license cancellation doesn't matter at all because Debian will continue to support their Java packages the same way they support every other package in their repositories.

karel

Posted 2019-06-15T09:22:09.870

Reputation: 11 374

You can also install openjdk-8 from the jessie-backports archive. – GiantTree – 2019-06-15T09:41:01.353

Thanks. my goal is to install Java 8. if I run sudo apt-get install openjdk-7-jdk java 7 is installed, I could not find a way to install java 8. any idea? – TheUnreal – 2019-06-15T10:09:34.703

@GiantTree How I can do this? – TheUnreal – 2019-06-15T10:10:23.007

1

@TheUnreal it is more complicated now than it was some time ago. The easiest solution would be to install a modern Debian version (Stretch/9 now and Buster/10 in a few weeks). On Debian 8 activate the jessie-backports like here: https://unix.stackexchange.com/a/508840 and then install openjdk-8-jdk from there (using apt install -t jessie-backports openjdk-8-jdk).

– GiantTree – 2019-06-15T10:37:02.890