Image for post
Image for post

Hacking Oracle Web Installer

Unless Slow Fetch-Download Installs is Preferred

For anyone that has installed Oracle Java™ on Ubuntu, you know the process is notoriously slow. What you might not know is that the official Oracle Debian package doesn’t actually contain the software, they are just wrapper scripts that download the package from a third-party partner mirror. Occasionally these mirrors are not operational or are notoriously slow.

Configure A Web Server

You want to create a location where you can store the tarball, such as /var/www/java, and then copy the target tarball to the location.

mkdir -p /var/www/java
cp /tmp/jdk-8u161-linux-x64.tar.gz /var/www/java
server {
listen 80;
server_name download.oracle.com;
access_log /var/log/nginx/java-access.log;
error_log /var/log/nginx/java-error.log;
location / {
rewrite /.*/(.*) /$1 last;
root /var/www/java;
autoindex on;
}
}
172.16.0.50    download.oracle.com

Configure The Client

The only thing needed on the client is /etc/hosts entry to point to our web server that hosts the Java tarball.

172.16.0.50    download.oracle.com

Install Oracle Java

Now you can embark on the journey of installing Oracle Java™ using their official installer program. To get their installer, simply do the following:

apt-get install oracle-java8-installer

Maintaining Versions

This works really well with the current Oracle Java™ JDK 8 on Ubuntu 14.04 Trusty Tahr. As you are downloading the tarball outside of Oracle’s Partner network, you’ll have to routinely fetch new versions to keep up with the Oracle Webupd8 Team’s installer.

apt-get install oracle-java8-installer=8u161-1~webupd8~0

Written by

Linux NinjaPants Automation Engineering Mutant — exploring DevOps, Kubernetes, CNI, IAC

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store