title: Why JAVA_HOME not recognized by tomcat7 in Ubuntu?
body: <p>I have installed tomcat7 on my Ubuntu machine. When I try to restart the server I get message to set JAVA_HOME but it is set in .bashrc</p>
  
  <pre><code>export JAVA_HOME=/usr/lib/jvm/java-8-oracle
  export CATALINA_HOME=/usr/share/tomcat7
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>omkars@&lt;ubuntu_14.04&gt;:~$ sudo service tomcat7 restart
  [sudo] password for omkars: 
   * no JDK or JRE found - please set JAVA_HOME
  omkars@&lt;ubuntu_14.04&gt;:~$ echo $JAVA_HOME
  /usr/lib/jvm/java-8-oracle
  </code></pre>
  
  <p>What could be missing ?
  Thanks.</p>