java.lang.UnsupportedClassVersionError: myApp : Unsupported major.minor version 51.0 (unable to load class myApp) On Linux
Recently I am the facing problem with Apache Tomcat 6.0.35 on Linux Centos. I am getting the error -
java.lang.UnsupportedClassVersionError: myApp : Unsupported major.minor version 51.0 (unable to load class myApp)
When I give the command -
java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.9) (rhel-18.104.22.168.9.el5_8-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
Similarly When I give the command -
It shows -
To locate the Java I give the command -
The output is -
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz
It displays -
Where myApp is java project developed in Windows and Uploaded the WAR file in Tomcats' webapp directory on Linux.
I am not getting what is happening? Please can anybody please help me to resolve the problem?
Thanks in advance.
You need a Java 7 runtime, not Java 6. See http://en.wikipedia.org/wiki/Java_class_file#General_layout for some details concerning this.
Alternatively, you need to find and/or re-compile your code to be compatible with Java 6.