title: Why am I getting an UnsupportedClassVersionError: Unsupported major.minor version 51.0 with some JREs?
body: <pre><code>SEVERE: Exception starting filter struts2
  java.lang.UnsupportedClassVersionError: 
  Unsupported major.minor version 51.0 (unable to load class com.directv.actions.indexAction)
      at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2922)
      at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1174)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1669)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
      at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:139)
      at com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:100)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:366)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:329)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
      at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
      at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
      at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
      at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
      at org.apache.catalina.core.ApplicationFilterConfig.&lt;init&gt;(ApplicationFilterConfig.java:107)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I am getting the above error when I try to start my application using Tomcat7 on a Linux server, but on Windows 7 using Tomcat7, JDK 7, it works fine.</p>
  
  <pre><code>java version "1.6.0_22"
  OpenJDK Runtime Environment (IcedTea6 1.10.8) (fedora-65.1.10.8.fc15-i386)
  OpenJDK Client VM (build 20.0-b11, mixed mode)
  </code></pre>
  
  <p>I can easily replicate this error on my Local machine simply by changing the Installed JRE, so I tried to compile the classes using 1.6 but am still getting the same error. How can I resolve this issue?</p>