Link

This articles gives the exact steps needed to install jdk on debian based linux distributions… really helpful..

Text

How to set JAVA_HOME in Debian based distros (Ubuntu/Linux Mint)

edit /etc/bash.bashrc file and include the following at the bottom

JAVA_HOME=/usr/lib/jvm/java
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

(Source: zimbio.com)