The project developed in Eclipse has a JDK that can be configured in the Java build path, and a Java compiler can be configured with compiler level, two of which are different, build The JDK version of path is what the compiler needs to use when you develop the code in Eclipse, to give you an indication of the error, the compile process, and the compiled version number in Java compiler compliance level, which is the function of After you have developed this project in the future, put it on the server and run the JDK version on that server. Colleague's problem is that the build path is configured with a Jdk,java of 1.7 compiler compliance Level is configured in the 1.7, but the server is 1.6 of the JDK, the error is reported that the compilation of the JDK (1.7) is higher than the JDK (1.6) used to run, this is wrong.
Summary: The JDK version of Build path is what the compiler needs to use when you develop it, for example, if you use JDK1.4, you cannot use generics. And the Java compiler compliance level is set by the Java code you have written, according to what JDK version is compiled, For example: Set is 1.4, the compiled class file can be run on more than 1.4 JRE, if the use of 5-level compilation, you can not run in the environment of 1.4, will be prompted version too high.
Supplement: After the example proves that when developing in eclipse, the JDK in Build path compiles the class library (that is, you use the class is not in this JDK), Java compiler compliance Level is a compilation of the syntax of the project (which is the correct syntax in your project), and in the process of development, these two places work. So, the safest thing to do is that build path and Java Complier compliance level and the JDK of the server configuration are all consistent and there is no problem.
Unsupported Major.minor version 51.0 workaround