Wednesday, May 28, 2014

Oracle Java on Debian GNU/Linux: Why and how

Java is proprietary software owned by Oracle (and previously Sun). Proprietary software and open operating systems such as Debian are not happy bedfellows.

Even when a Linux version of proprietary software is available, it tends to not be open source. It's simply the installation file.

Debian especially is keen for users to install free software and open source software. It is however possible to install proprietary software through roundabout means.

To stick to standard Debian-recommended software, I have been using OpenJDK on my laptop running Debian. This works reasonably well although the Icedtea web plugin that appears when Java applets on websites are executed is not pretty.

My bank uses a Java applet at the two-step login stage for Internet banking. For some reason, I've had to set a password every time I reach the second stage containing the Java applet, and this is a cumbersome process involving an SMS sent to my phone. This was not a problem on my Windows computer.

I suffered with it, but recently my bank locked me out because I had set a password too many times.

I can deal with some inconvenience as a result of using software that's not quite mainstream, but getting locked out of my online banking account is not okay.

So I decided to set up Oracle Java. This is what I did:
  • Downloaded the Java Development Kit installation file 
  • Selected the correct file (for me it was jdk-7u55-linux-i586.tar.gz)
  • Put the stuff in the right place by typing this in the command line: 
> sudo tar zxvf jdk-7u55-linux-i586.tar.gz -C /usr/lib/jvm
  • Created a link within the Firefox plugins folder that pointed to the Oracle Java runtime environment:
> ln -s /usr/lib/jvm/jdk1.7.0_55/jre/lib/i386/ /usr/lib/mozilla/plugins/

And that was it!

There is a more proper way to set up Oracle Java runtime environment, which is described in several places such as here.