简体   繁体   中英

Class file has wrong version 55.0, should be 52.0 (IntelliJ)

Originally, when trying to compile the maven project in IntelliJ, I got the following error:

Error:java: invalid source release: 11

I then began by following some of the solutions here: Error:java: invalid source release: 8 in Intellij. What does it mean?

The previous projects I worked on were in Java 8, so after changing SDKs, language levels, JREs, etc. to Java 8, I have gotten this error:

Bad class file. class file has wrong version 55.0, should be 52.0

I know this is essentially saying the class file is Java 11 and should be 8, but is there anything else I am missing that could still possibly be trying to use Java 11? I even uninstalled Java 11, but am still getting the same error.

I got the class file has wrong version 55.0, should be 52.0 on the command line when compiling a project with Maven while my Java was set to version 8/1.8. I believe CrazyCoder was correct in the comments to the question that it had to do with the libraries/classes being used. I managed to compile the project by switching my Java version to 11.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM