Introduction:
Debian Squeeze has only Java6 available. So here is one method to install Java7 on Debian Squeeze.

Method 1: TARBAL. Steps
cd /usr/src
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u72-b14/jre-7u72-linux-x64.tar.gz"
tar -xvzf jre-7u72-linux-x64.tar.gz
mkdir /usr/lib/jvm
mv /usr/src/jre1.7.0_72 /usr/lib/jvm/
ln -s /usr/lib/jvm/jre1.7.0_72/ /usr/lib/jvm/java-7-oracle
cd /etc/alternatives
mv java java.6
ln -s /usr/lib/jvm/java-7-oracle/bin/java java
java -version