Issue
I have downloaded a web application project onto my Mac OSX 10.8.2 and I am using the Apache ant
to compile it. I am getting this error when the application is running, attempting to compile-and-execute a JSP:
javax.servlet.ServletException: java.lang.UnsupportedClassVersionError
Unsupported major.minor version 51.0
I have searched for this problem on the web, and it seems this problem is caused by the compiled version being different from the running version of Java. All the suggested solutions are to "set the compiler version in Eclipse," but I am not using Eclipse...
This is my environment:
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
How can I check the ant-compiled version(s) of my class files and resolve this problem?
Solution
UnsupportedClassVersionError is mainly because of the java version mismatch between running and compile versions .
Both versions should match in order to avoid the error GO through the below link to get more details about the ant version change.
Why is Ant giving me a Unsupported major.minor version error
Answered By - Suresh Atta
Answer Checked By - Marie Seifert (JavaFixing Admin)