Home > Net >  Error:Kotlin: Module was compiled with an incompatible version of Kotlin in a project of Spring Boot
Error:Kotlin: Module was compiled with an incompatible version of Kotlin in a project of Spring Boot

Time:02-14

Intellij IDEA and JDK 11, this is not an android project, not using Kotlin. It is a Spring Boot application generated with initilizer. Like this:

https://start.spring.io/starter.zip?type=maven-project&language=java&bootVersion=2.6.3&baseDir=demo&groupId=com.example&artifactId=demo&name=multidatasource&description=Demo project for Spring Boot&packageName=com.example.demo&packaging=jar&javaVersion=11&dependencies=lombok,data-jpa,mysql,webflux,data-rest

Then I added service code in it. When built, it stopped for been missing error, after I fix them, it cannot be built at all, IDEA gives error:

Information:Kotlin: kotlinc-jvm 1.3.41 (JRE 11.0.4 10-b304.77)

Information:2/11/2022 3:20 PM - Build completed with 1 error and 0 warnings in 1 s 823 ms

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.

pom.xml remains the same as generated from above link. I checked IDEA module settings, nothing odd. And I grep -rn kotlin * in project folder, no matched result.

Then I wonder if it is because dependency has kotlin confliction, so I start from a fresh download project, and run it successfully (it proves that kotlin problem is not because of dependencies); then I replace folder src, it run successfully too.

Has anyone used a Spring Boot Java maven, and IDEA, and perhaps JDK11, and encountered the same error?

Thanks.

Error

updates: I think this is an Intellij IDEA bug, not all run has this problem

CodePudding user response:

I have just had the exact problem. Just go to the Build menu and click on the rebuild project.

  • Related