I used sudo apt-get open-jdk7 to install Java on my Ubuntu OS. 
When I open a terminal and type echo $JRE_HOME it displays nothing. But then I do java -version it shows me correct version of OpenJDK. Also when I simply type java it works.
Not sure how Ubuntu set the path of java.
Similarly javac works but I don't see anything when I say echo $JAVA_HOME.
My path does not show java directory path in it.
Where is Ubuntu setting the java path?  Why does Ubuntu not set JAVA_HOME and JRE_HOME during installation of OpenJDK?