Yeah, be careful on Ubuntu (or Linux in general) about what Java is
used, because on some versions at least GCJ is installed by default
instead of OpenJDK and GCJ sucks - though I think this is no longer so
in later versions of Ubuntu.
Also, I saw some people recommend against OpenJDK in production
systems, although I've never had issues with it and I don't really get
what the fuss is about. I think it has some performance issues with
Swing (the GUI toolkit) or something like that.
But just in case you have problems and want to experiment with
Oracle's JDK in a production (e.g. the non open-source version) you
can do so by adding the PPA of webupd8team, like so:
sudo add-apt-repository ppa:webupd8team/java
And then you can install it:
sudo apt-get update && sudo apt-get install oracle-java7-installer
After which you need to select it as the default, with
update-java-alternatives, just as I taught you :-)
For an automatically provisioned production system, if you want to
install stuff by scripts, like with Fab or Puppet, installing the JDK
with the above mentioned installer has a nasty habit of asking you to
agree with Oracle's restrictive terms and conditions, blocking your
script, so I'm going to leave this here for reference on how to
workaround that:
sudo echo oracle-java7-installer shared/accepted-oracle-license-v1-1
select true | sudo /usr/bin/debconf-set-selections
Again, I'm mentioning this just for reference in case you have
problems and want to see if it makes a difference, because the truth
is I trust OpenJDK more even in production, as I'm pretty sure that
the OpenJDK from Ubuntu receives security updates faster.