title: Find JAVA_HOME and set it on RHEL
body: <p>I had installed java a while ago on my RHEL machine. Now, I'm trying to run a program that requires the <code>JAVA_HOME</code> variable to be set. What is the best way to figure out the installation directory of my java installation and then set <code>JAVA_HOME</code>? Here are the results of running <code>java- version</code>:</p>
  <pre><code>java version &quot;1.7.0_25&quot;
  Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
  Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
  </code></pre>
  <p>I have a <code>/usr/lib/jvm</code> directory, but it is empty.</p>