title: Error when starting Tomcat, unsupported major/minor version, environment variables seem correct though
body: <p>I'm having a problem starting Tomcat 7 from the command line on Linux, and the log shows this:</p>
  
  <pre><code>Sep 24, 2012 8:54:10 AM org.apache.catalina.core.AprLifecycleListener init
  INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the jav
  a.library.path: /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/amd64/server:/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/amd64:/u
  sr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/../lib/amd64:/usr/lib64/mpi/gcc/openmpi/lib64:/usr/java/packages/lib/amd64:/usr/lib64:/lib6
  4:/lib:/usr/lib
  Sep 24, 2012 8:54:10 AM org.apache.tomcat.util.digester.Digester startElement
  SEVERE: Begin event threw error
  java.lang.UnsupportedClassVersionError: pms/security/BCryptRealm : Unsupported major.minor version 51.0
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
          at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
          at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
          at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:144)
          at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504)
          at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.jav
  a:1320)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScann
  erImpl.java:2732)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:48
  8)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
          at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
          at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
          at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
          at org.apache.catalina.startup.Catalina.load(Catalina.java:610)
          at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:616)
          at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)</code></pre>
  
  <p>From googling I understand the first bit I can just ignore, but I was wondering if that's indicative of the version of Java it's trying to use, since it keeps saying Java 6. The "Unsupported major.minor version 51.0" I understand means I have a problem with Java versions somehow. </p>
  
  <p>I built the class it's having problems with (a custom realm to use BCrypt) using ant, and running ant -v shows it's compiling with Java 7, which is what I want. I've set JAVA_HOME and JDK_HOME to use Java 7 as well (they're all pointing to the same place as far as I can tell). </p>
  
  <p>What else am I missing? If more info is needed let me know. I'd really appreciate any pointers on where I should look for whatever is going wrong. Thanks.</p>
  
  <p>ETA a little more info per questions in comments:
  I'm starting tomcat via the command line. I just do ./bin/startup.sh from the tomcat base directory. I downloaded tomcat from the <a href="http://tomcat.apache.org/download-70.cgi" rel="noreferrer">Apache website</a>. I got the core tar.gz version and unpacked it just last night (I only had version 6 before and wanted to upgrade). Also this isn't my personal machine; I only have user rights, if that matters.</p>