I'm trying to install Hadoop on Ubuntu 11.10. I set the JAVA_HOME variable in the file conf/hadoop-env.sh to: 
# export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
and then I execute these commands (Standalone Operation):
$ mkdir input 
$ cp conf/*.xml input 
$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+' 
$ cat output/*
but I have the following error when executing the third command:
ERROR : JAVA_HOME is not set
Is the JAVA_HOME variable not set correctly?
 
                        
You can add in your
.bashrcfile:and it will dynamically change when you update your packages.