I\'m trying to install Hadoop on Ubuntu 11.10. I set the JAVA_HOME variable in the file conf/hadoop-env.sh to:
JAVA_HOME
conf/hadoop-env.sh
# export JAVA_HOME=
You can add in your .bashrc file:
.bashrc
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
and it will dynamically change when you update your packages.