title: How to setup tomcat7 in ubuntu 14.04 so that it uses latest JRE of java-8-oracle?
body: <p>when I compile a servlet using java-8-oracle in eclipse and put the classes file in tomcat7/webapps directory , I get a <code>Unsupported major.minor version 52.0</code> error. But when I compile the version with JDK compliance 1.6 , the servlet runs just fine. Here are my outputs of different settings</p>
  
  <pre><code>$ java -version
  java version "1.8.0_40"
  Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
  Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
  </code></pre>
  
  <p>the folders in /usr/lib/jvm </p>
  
  <pre><code>$ ls
  default-java              java-1.7.0-openjdk-amd64  java-7-openjdk-amd64
  java-1.5.0-gcj-4.8-amd64  java-6-openjdk-amd64      java-8-oracle
  java-1.6.0-openjdk-amd64  java-6-openjdk-common
  </code></pre>
  
  <p>Here is my /etc/environment file</p>
  
  <pre><code>PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ga mes:/usr/local/games"
  JAVA_HOME="/usr/lib/jvm/java-8-oracle"
  JRE_HOME="/usr/lib/jvm/java-8-oracle"
  </code></pre>
  
  <p>and lastly I appended this line <code>export JRE_HOME="/usr/lib/jvm/java-8-oracle"</code> to my .bashrc in home directory.</p>
  
  <p>So how can I setup tomcat7 to use the java-8-oracle ?  </p>