I have Google App Engine project that I have been working on. Everything was fine until I did an update of my jdk7. Now when I deploy my app I am getting servlet java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0 exception. Did some research that said this exception is cause by byte code compiled by a newer jdk running a older jvm. So I looked for the oldest version of the jdk I could find jdk6u36 and deployed my project using that and still have the project (Did some other embarassing stuff to see what exactly was causing the problem like remove all of my class file a test them one by one and get the same problem with all of them). Please I really need help to solve this problem.
-
possible duplicate of http://stackoverflow.com/questions/8139477/google-app-engine-and-java-version – Rajesh Pantula Oct 20 '12 at 07:20
2 Answers
Did some research that said this exception is cause by byte code compiled by a newer jdk running a older jvm.
That is right ...
So I looked for the oldest version of the jdk I could find jdk6u36 and deployed my project using that and still have the project ...
Well obviously that won't work! You are compiling on a newer JDK and deploying on an older JDK / JRE. You need to compile on the older JDK. That is what your research just told you ...

- 698,415
- 94
- 811
- 1,216
-
But did when I downloaded the jdk6 and add it to my build path. I assume that eclipse re-compiles the project when deploying it to the app engine to shouldn't that fix my problem? – Mario Dennis Oct 20 '12 at 12:10
Has you guys stated I am compiling on newer JDK and deploying on an Older JRE. So to solve the problem I changed the compiler for my project to jdk 6, by right clicking on the project->properties->java compiler. I also changed the JAVA_HOME environment variable to point to the location of the JDK6 and that solved my problem. Thanks alot

- 2,986
- 13
- 35
- 50