Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Install Fails On Ubuntu 14

I am trying installl jave 8 (jre/jdk) in my ubuntu 14.0.4

sudo apt-get update

sudo apt-get install oracle-java8-installer

I get below error

Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2017-10-17 16:42:09--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 64.78.224.186, 64.78.224.185
Connecting to download.oracle.com (download.oracle.com)|64.78.224.186|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz [following]
--2017-10-17 16:42:10--  https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.217.152.181, 2600:141b:13:28c::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.217.152.181|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508276650_49e5615c0aa8584dd72b809fbec787eb [following]
--2017-10-17 16:42:10--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1508276650_49e5615c0aa8584dd72b809fbec787eb
Connecting to download.oracle.com (download.oracle.com)|64.78.224.186|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-10-17 16:42:11 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.

looks like it is looking for 8u144 which is not available.

How can i make it look for 8u151?

I did this sudo add-apt-repository ppa:webupd8team/java -> no luck

like image 652
KitKarson Avatar asked Oct 17 '17 22:10

KitKarson


3 Answers

This has been an issue as of today (we hit the webupd8team ppa once a day for oracle-8-installer). From past experience it's probably due to the fact that Oracle released their quarterly Java updates overnight (8u151 and 8u152), and moved or deleted 8u144. If you dig into the ppa you'll see it only references 8u144.

I'm not that knowledgable on how the webupd8team ppa is managed, but presumably it requires some manual intervention on the maintainer's part to fix the issue.

like image 168
jamesinc Avatar answered Sep 30 '22 06:09

jamesinc


I am trying out this solution: https://ubuntuforums.org/showthread.php?t=2374686 -> No luck at the moment

What works for me, I tried manually with this:

  1. Create a folder to put JDK

    mkdir /opt/jdk cd /opt

  2. Download the latest JDK:

    wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-linux-x64.tar.gz

  3. Extract it

    tar -zxf jdk-8u152-linux-x64.tar.gz -C /opt/jdk

  4. Set it as default

    update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_152/bin/java 100

    update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_152/bin/javac 100

like image 28
zdharmawan Avatar answered Sep 30 '22 04:09

zdharmawan


"As a temporary work around":

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.*

And then try installing JAVA again. From this ubuntuforums thread.

like image 39
Cumulo Nimbus Avatar answered Sep 30 '22 05:09

Cumulo Nimbus