I am trying to install java 8 through oracle-java8-installer on a debian:jessie docker container. The following is my Dockerfile:
FROM debian:jessie
ENV JAVA_VERSION 1.8.0
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > /etc/apt/sources.list.d/webupd8team-java.list
RUN echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
RUN echo "debconf shared/accepted-oracle-license-v1-1 select true" | /usr/bin/debconf-set-selections
RUN apt-get update
RUN apt-get install -y --force-yes vim
RUN apt-get install -y --force-yes oracle-java8-installer
Yet this gives:
Connecting to download.oracle.com (download.oracle.com)|23.63.224.171|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-17 12:31:05 ERROR 404: Not Found.
download failed
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get install -y --force-yes oracle-java8-installer' returned a non-zero code: 100
I have found many similar issues described online, but none of the proposed solutions worked for me. Any idea?
Re to donhector's response and your question: you need to replace the strings in the installer file, instead of yours last command:
run these commands:
I have them in a separate script and run it as
or you can run them directly from your Dockerfile, that's up to you.
Found the solution on https://hub.docker.com/r/anapsix/docker-oracle-java8/~/dockerfile/:
The "secret sauce" you were looking for is the first line:
You are installing from the webupd8 PPA repo. If you notice, the Java 8 package in that repo points to Java 8 version
151
. That package pulls the binary for151
from the Oracle servers (since Java Oracle licence does not allow anyone else hosting the binaries). Oracle released version161
a couple days back and apparently moved or removed151
from their servers. So basically the package in the webupd8 PPA repo is trying to download the151
binary which no longer exists at the location that the webupd8 package expects it (hence the 404 you got). The webupd8 PPA repo maintainer will have to release a new package pointing to the new161
binaries from Oracle. Docker or Debian don't play any role in the issue, it is just basically a broken link issue.Until then you could apply a "workaround" like the one mentioned here: JDK 8 is NOT installed - ERROR 404: Not Found
Here's the list of Java packages in the webupd8 repo:
https://launchpad.net/~webupd8team/+archive/ubuntu/java/+packages
See dpkg oracle Jdk error while installing cassandra in Ubuntu 16.04. This issue is occurring for everyone using install scripts of any kind.