I installed Java in my red hat machine and when I run java -version, it is showing my installed java version.
However, when I run echo $JAVA_HOME, nothing is displayed.
I installed Java in my red hat machine and when I run java -version, it is showing my installed java version.
However, when I run echo $JAVA_HOME, nothing is displayed.
echo $JAVA_HOME
Will print the value if it's set. However, if you didn't set it manually in your startup scripts, it probably isn't set. That's why it is empty.
You can set it up using (or equivalent)
export JAVA_HOME=/home/user/jdk1.7.0_02/