I installed Java Sun 6 for Hadoop file system but everytime I try to set it as Java Home, it gets back to be not set as soon as I close the terminal.
Can anyone tell me what to do ?

I used the commands :
sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java-6-sun
export JAVA_HOME=/usr/lib/jvm/java-1.6.0_24

Thanks in advance.