September 23, 2008 at 3:39 PM
This kind of error due to this :
Thrown when the Java Virtual Machine attempts to read a class file and determines that the major and minor version numbers in the file are not supported.
This exception can occur when the source is built targeting a JDK that is not supported by the JDK attempting to run it. In the above example, if the servlet was built targeting only JDK 1.5, but the web server runs JDK 1.4, the above exception will occur.
Check, Project Properties | Build | Java | Target VM, and verify that the Target VM indicates a JDK compatibility that is appropriate for the JDK that is running it. It is recommended to set this field to 'All Java SDKs' for the most compatibility. The only reason you would want to specify a particular version is if your code uses language features that only appear in a particular verison of the JDK, and you want to ensure that users use only a compatible JDK.
Also check, Project Properties | Build | Java | Language Features, and verify that the Language Features are applicable with JDK that is running it.