Ubuntu 11.04
open terminal
JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.24/
export JAVA_HOME
echo $JAVA_HOME
==>/usr/lib/jvm/java-6-sun-1.6.0.24/
i close the terminal
open another terminal
echo $JAVA_HOME
==>
Any idea why JAVA_HOME was not saved ?
The environment variable is only set for that session and its children. When you close that terminal process, those environment variables are gone. Typically I would set them in ~/.profile, but that may not be the preferred method.
The Ubuntu documentation for this is here
Your missing the "-p" for "permanent".
It has some bugs, but here is what I use.