Score:1

Oracle JDK-1.8 installation issue on Ubuntu-20.04-LTS

eg flag

With below Dockerfile trying to install Oracle JDK-1.8. But it fails during docker build.

# Pull base image.
FROM ubuntu:20.04

# Install Oracle JDK 1.8
RUN add-apt-repository ppa:webupd8team/java && \
    apt-get -y update
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
RUN echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections

RUN apt-get -y install oracle-java8-installer && \
    java -version
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

Docker build errors,

Debian installation instructions:
- Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html
 More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Ign:3 http://ppa.launchpad.net/webupd8team/java/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Err:5 http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release
  404  Not Found [IP: 91.189.95.85 80]
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists...
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu focal Release' does not have a Release file.
The command '/bin/sh -c add-apt-repository ppa:webupd8team/java && apt-get -y update' returned a non-zero code: 100

As per this link Noticed that PPA support is available till Ubuntu-16.10.

Our PPA supports Ubuntu 16.10, 16.04, 15.10, 14.04 and 12.04 as well as Linux Mint 18, 17.x and 13. Add the PPA and install Oracle Java 8 (the package provides both JDK8 and JRE8) using the following commands:

Is there any workaround to install oracle JDK-1.8 on Ubuntu-20.04-LTS docker?

Score:2
zw flag

It seems that you blindly adding some PPA to your Dockerfile. This Oracle Java (JDK) 8 Installer PPA (DISCONTINUED) does not provide packages for 20.04 LTS (focal) - see http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/ , also it is now marked as discontinued by its owners.

You have to replace this PPA by some other, for example this “Hellenic Schools Technical Support Team” team PPA provides needed package for Ubuntu 20.04 LTS .

So you have to put the following line into Dockerfile:

add-apt-repository ppa:ts.sch.gr/ppa
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.