title: How to change Java version used by TOMCAT?
body: <p>I have Java 1.6 and Tomcat 5.5 installed on my system.</p>
  
  <p>But Tomcat 5.5 accesses Java 1.5 and hence as the outcome I get the error <code>Bad version number in .class file</code> while executing java code with JSP.</p>
  
  <p>How can I change the Tomcat version to Java 1.6?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried changing the JVM that the tomcat5w.exe is pointing to the version 1.6 and now I am out of the <code>Bad version in .class file</code> error. But now, I get the following error.</p>
  
  <pre><code>exception
  
  org.apache.jasper.JasperException
  org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
  
  root cause
  
  java.lang.NullPointerException
  myfirst.SearchLink.checkURL(SearchLink.java:20)
  org.apache.jsp.Test_jsp._jspService(Test_jsp.java:52)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
  </code></pre>
  
  <p>What might be the root cause?</p>