Ubuntu 12.04 is a LTS (Long Term Support) release, for desktop as well as server edition. Just after a fresh install of Ubuntu 12.04, you need to install few things to get everything running, atleast for common tasks (you may find my previous post useful – things to do after a fresh install of Ubuntu 12.04).
But, remember if you want to develop Java Applications then you need more (JDK, Docs etc) than just a JRE. So checkout this post – Install JDK on Ubuntu 12.04 if you want full development environment rather then just the run time environment.
Installing JRE/Java on Ubuntu 12.04
There are many implementation of Java Runtime environment but we will stick to the Open Source implementation of Java – OpenJDK (Open Java Development Kit). The latest stable version is openjdk-7 (although v 8 developer preview version is also available). a terminal (hit Ctrl+Alt+t, to open a bash shell or terminal or whatever shell (such as zsh) you prefer) and execute these command(s) –
sudo apt-get install openjdk-7-jre
(The package size is around ~30MB)