The solution of “unsupported major. Minor version 52” in Java project compilation

Open source software supply chain lighting plan, waiting for you>>>

As shown in the title, the reason for this problem is: this error will appear when the project compiled by the higher version of JDK is put into the eclipse environment where the lower version of JDK is compiled. Therefore, if you want this project to run normally in the low version environment, you can solve it according to the following ideas:

(1) Check the JDK environment variables to ensure that the JDK environment variables have been configured correctly

(2) Modify Java build path:

Right click the project in eclipse, properties – > Java Build Path –> Libraries, delete those that don’t exist, and reselect the existing libraries, such as jdk1.7, tomcat7.0, etc

After this step, refresh the project and recompile it. If you still report an error, please continue to read on

(3) Modify project faces:

As above, right-click the project in eclipse and click Properties – > Project Facets

Here, I mainly modify these two configurations in my circle. The above 3.0 corresponds to jdk1.7, and 3.1 corresponds to JDK1.8

If you can’t modify it here, or refresh the project after modification and still report an error, please continue to read on

(4) Modify org.eclipse.wst.common.project.facet.core.xml:

Open the folder where the project is located, open the. Settings folder, and modify the “org. Eclipse. WST. Common. Project. Facet. Core. XML” file in it

Just as above, modify the version here directly, then go back to the project in eclipse, refresh the project and recompile it

(5) Last trick:

If all the above steps are finished and this error still occurs, we can only make a unique move. That is:

back up the source project

and create a new dynamic Java project in eclipse

copy all the java files, configuration files, foreground pages and other files in the source project to the new project

compile and run new projects

I believe that this step has been achieved and this problem can be solved

PS: the domain name in the picture above is my personal blog’s domain name, which is not reproduced by other websites. Please don’t mark it as “reproduced article” for me

Similar Posts: