Sunday, February 9, 2014

Ubuntu Beginner Pain: Installing Java 7


I found I had to do this because I was having difficulty installing JetBrains' WebStorm on Ubuntu. In fairness I'm an Ubuntu neophyte. My exposure to Linux is generally small tasks done in a terminal on servers.

Mistake: Just Installing Oracle Java

The first thing I tried to do was just install Oracle Java. This would complete, but I would still have the wrong version of Java when I typed java -version in Terminal. This confused me for hours. I googled, and googled, and found about 20 different solutions that didn't work.  Finally ran into one answer that gave me a clue (I need to dig up the link, sorry). OpenJRE was gunking things up.

OpenJRE on Ubuntu

Ubuntu comes with OpenJRE stuff installed on it by default. I'm not at all sure what "OpenJRE" is or why it exists. It seems to be some sort of licensing issue deal were Oracle had a disagreement with Ubuntu and some weird new Java baby was born.

Either way, I want "real" Java, not whatever this is.... so let's get rid of it.

Answer: First remove OpenJRE, then install Oracle Java!

Here are the commands I ran to fix up Java on my machine. Annotated:


  1. It all about freedom in the Linux world. The majority of things that are seen as more difficult than they should be for new users come back to that. A lot of people do not want any software that is not free to be installed with the OS by default, so alternatives are included instead.


This form allows some basic HTML. It will only create links if you wrap the URL in an anchor tag (Sorry, it's the Blogger default)