Working with Oracle Java Environment

June 14, 2018


I have spent a lot of time trying to figure out an issue with Java environment on Ubuntu. I was not able to install Oracle Java 8 so I have seen various issues when I was installing multiple packages. Some errors like this:

The actual errors are pretty much hidden from user. It is actually a failed install of Java 8. The interesting thing was that I didn't get the HTTP 404 error during apt-get install. Instead, I got the HTTP 503 error, indicating the server was not in response, but the link was valid.


I have found the following pages useful.

Initial finding

https://launchpad.net/~webupd8team/+archive/ubuntu/java


Install Java 8:

http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html


Install Java 10 (only available for 64-bit machine)

https://www.linuxuprising.com/2018/04/install-oracle-java-10-in-ubuntu-or.html


I have also found that I need to update /etc/apt/apt.conf to add the following entries:


Acquire::http::proxy "http://proxy_address:proxy_port/";

Acquire::https::proxy "http://proxy_address:proxy_port/";


This is because I have been working behind a corporate proxy. Now I am able to install Java 8 again.