Java
To install Java realise that most users will only need OpenJRE and the Java browser plugin which you can install by using the following command:
sudo apt-get install icedtea-7-plugin openjdk-7-jre
For development, you'll also want OpenJDK which you can install by using the following terminal command:
sudo apt-get install openjdk-7-jdk
If for various reasons, you need Oracle Java (the package includes JDK, JRE and the browser plugin), you can install Oracle Java 7 by using the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer