Zile Rehman
Zile Rehman

Reputation: 51

oracle-java8-installer Webupd8 PPA 404 Not Found

The following error is thrown when you execute sudo apt-get install oracle-java8-installer:

Location: http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508340360_7be4aa21e145dd26bda475add7c27ada [following]
                    --2017-10-18 08:24:00--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508340360_7be4aa21e145dd26bda475add7c27ada
                    Reusing existing connection to 2.2.0.1:8080.
                    Proxy request sent, awaiting response... 404 Not Found

A temporarily workaround is:

cd /var/lib/dpkg/info
sudo sed -i 's|JAVA_VERSION=8u144|JAVA_VERSION=8u152|' oracle-java8-installer.*
sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/|' oracle-java8-installer.*
sudo sed -i 's|SHA256SUM_TGZ="e8a341ce566f32c3d06f6d0f0eeea9a0f434f538d22af949ae58bc86f2eeaae4"|SHA256SUM_TGZ="218b3b340c3f6d05d940b817d0270dfe0cfd657a636bad074dcabe0c111961bf"|' oracle-java8-installer.*
sudo sed -i 's|J_DIR=jdk1.8.0_144|J_DIR=jdk1.8.0_152|' oracle-java8-installer.*

Upvotes: 5

Views: 2416

Answers (3)

aboettcher
aboettcher

Reputation: 81

The ppa is great and I appreciate the work put into it. Recently oracle changed the paths and the ppa needs to be updated until it works again. In the mean time I found this workaround from the ubuntu forum helpful to install jdk8 (I removed the docker specific stuff):

### workaround to install oracle jdk8 until ppa will be updated
# install java via wget site oficial oracle
# note: JAVA_FILE_TAR, JAVA_URL_DOWNLOAD and JAVA_DIR  must be entered manually
export JAVA_FILE_TAR=jdk-8u191-linux-x64.tar.gz
export JAVA_URL_DOWNLOAD="http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/${JAVA_FILE_TAR}"
export JAVA_DIR=jdk1.8.0_191
# download and extract tar
cd /opt
wget -q --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" ${JAVA_URL_DOWNLOAD}
tar zxvf ${JAVA_FILE_TAR} && pwd && ls -la
# set default java
update-alternatives --install /usr/bin/java java /opt/${JAVA_DIR}/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/${JAVA_DIR}/bin/javac 1
update-alternatives --install /usr/bin/jar jar /opt/${JAVA_DIR}/bin/jar 1
# set temp env vars
export JAVA_HOME=/opt/${JAVA_DIR}
export PATH=$PATH:/opt/${JAVA_DIR}/bin:/opt/${JAVA_DIR}/jre/bin
echo "export JAVA_HOME=/opt/${JAVA_DIR}" >> /etc/environment
echo "export PATH=$PATH:/opt/${JAVA_DIR}/bin:/opt/${JAVA_DIR}/jre/bin" >> /etc/environment

Upvotes: 0

Die Minecrafter LP
Die Minecrafter LP

Reputation: 1

Late answer but I just found out another way to install java without any problems.

Just install openjdk 8

apt-get install openjdk-8-jre-headless

then test it through

java -version

See also: https://www.youtube.com/watch?v=fdB5dhPXiXc

Upvotes: 0

spac
spac

Reputation: 346

From https://ubuntuforums.org/showthread.php?t=2374686 below is reported the ansible playbook to install oracle-java8-installer implementing the workaround illustrated in the above answer (also coming from the same source, supposedly).

---

- name: Add Oracle Java webupd PPA
  apt_repository:
    repo: "ppa:webupd8team/java"


- name: Accept Java licence
  debconf:
    name: "oracle-java{{ java.version }}-installer"
    question: shared/accepted-oracle-license-v1-1
    vtype: select
    value: "true"


# - name: Install Oracle Java
#   apt:
#     name: "{{ item }}"
#     update_cache: yes
#     state: latest
#     force: yes
#   with_items:
#     - "oracle-java{{ java.version }}-installer"
#     - "oracle-java{{ java.version }}-set-default"


# Temporary fix for webupd8team installer issue
- name: Install Oracle Java
  block:
    - apt:
        name: "{{ item }}"
        update_cache: yes
        state: latest
        force: yes
      with_items:
        - "oracle-java{{ java.version }}-installer"
        - "oracle-java{{ java.version }}-set-default"
  rescue:
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|JAVA_VERSION=8u144|JAVA_VERSION=8u152|' oracle-java8-installer.*
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/|' oracle-java8-installer.*
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|SHA256SUM_TGZ="e8a341ce566f32c3d06f6d0f0eeea9a0f434f538d22af949ae58bc86f2eeaae4"|SHA256SUM_TGZ="218b3b340c3f6d05d940b817d0270dfe0cfd657a636bad074dcabe0c111961bf"|' oracle-java8-installer.*
    - shell: cd /var/lib/dpkg/info && sudo sed -i 's|J_DIR=jdk1.8.0_144|J_DIR=jdk1.8.0_152|' oracle-java8-installer.*
  always:
    - apt:
        name: "{{ item }}"
      with_items:
        - "oracle-java{{ java.version }}-installer"
        - "oracle-java{{ java.version }}-set-default"

Upvotes: 2

Related Questions