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

It Shows

java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.9) (rhel-1.28.1.10.9.el5_8-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

Similarly When I give the command -

javac -version

It shows -

javac 1.6.0_22

To locate the Java I give the command -

whereis java

The output is -

java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz

And for

which java

It displays -

/usr/bin/java

Also for

which javac

Output is

/usr/bin/javac

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.

Answers


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.


Need Your Help

Rails routes for an API documentation

ruby-on-rails ruby-on-rails-3 rest documentation routes

I'm currently writing the documentation for the API of my website.

How to Make use of a list of tables

xml r list table scrape

Using the XML package i was able to scrape over 80 tables from a website, and this number will grow over time as well. Tables them selves are not very large mostly 6x10 (this size varies between ta...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.