Recently apt-get install -y oracle-java7-installer
stopped working.
I know in their roadmap, I think the public version is no longer supported, but it's been working all the way until recently. http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Anyone have a work around for this?
http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1495560077_4041e14adcb5fd7e68827ab0e15dc3b1
Connecting to download.oracle.com (download.oracle.com)|96.6.45.99|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-05-23 10:19:17 ERROR 404: Not Found.
As the Oracle Java SE Support Roadmap explains, Java SE 7 is planned to exit Extended Support and enter Sustaining Support in July 2022, after 11 years of fixes, security and other critical updates.
It appears Oracle has moved the download link, you can still fetch the tar ball from the oracle website after jumping through some hoops. The WebUpd8 installer is currently broken. The official explanation can be found at http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html
The link now seems to be: http://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz notice "otn" and not "otn-pub", but at least from the website you seem to need to be signed in and not only accept the license agreement.
It may be possible with debconf to change the url from otn-pub to otn and get the installer to work but I haven't tried. You can fetch the binary yourself and either install manually or with the installer pointing it to wherever you put the downloaded tar ball.
Edit: It seems there isn't a way to configure download URL (though you can hijack it with hosts as in another answer).
If you want to download jdk-7u80-linux-x64.tar.gz from a script without logging into to oracle it hosted locations include:
EDIT: The sha256 has been removed from this answer because (as this edit demonstrates) anyone can edit said hash. Get your hashes from a trusted source. Suggestions include:
#put the file in the default cache location:
sudo mv jdk-7u80-linux-x64.tar.gz /var/cache/oracle-jdk7-installer/
#then install normally:
sudo apt-get install oracle-java7-installer
#setup ppa (you probably came here after already doing this)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
#put the file in a temporary location:
sudo mv jdk-7u80-linux-x64.tar.gz /tmp/
#set local path to /tmp (or any other path)
echo oracle-java7-installer oracle-java7-installer/local select /tmp | \
sudo /usr/bin/debconf-set-selections
#While your at it you may want tp approve license (or skip this and approve when prompted)
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | \
sudo /usr/bin/debconf-set-selections
#then install normally:
sudo apt-get install oracle-java7-installer
So looks like the direct links to the download no longer work( As noted by Meir Maor above)
Here are the steps to get this running again:
Go to http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html and accept the license. Download the file we need (jdk-7u80-linux-x64.tar.gz in this case)
Assuming the file downloaded to your Downloads directory, we need to move it to /var/cache/oracle-jdk7-installer
cd ~/Downloads (Change to directory to which you saved file from step 1)
sudo mkdir /var/cache/oracle-jdk7-installer
sudo mv jdk-7u80-linux-x64.tar.gz /var/cache/oracle-jdk7-installer/
Not sure if necessary but I had luck with this:
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
Run the installer now. It will use the file we saved in /var/cache instead of trying to download it from Oracle
sudo apt-get install oracle-java7-installer
I got step 3 from http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With