Installation

Basic

_$: sudo apt-get install openjdk-7-jre-headless

With updates

_$: sudo add-apt-repository ppa:webupd8team/java
_$: sudo apt-get update

Versión 7)

_$: sudo apt-get install oracle-java7-installer

Versión 8)

_$: sudo apt-get install oracle-java8-installer

Check

_$: java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)