Module was compiled with an incompatible version of Kotlin.

现象:The errors indicate that there are modules compiled with different versions of Kotlin than the one expected by the current project.

Specifically, the expected version is 1.1.15, but we have modules compiled with metadata versions 1.7.1, 1.6.0, and 1.5.1.

一、问题:运行spring boot项目时,idea报出错误:时提示报错如下图:

错误代码:

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

二、产生原因:

这个报错大概意思:模块是用不兼容的Kotlin版本编译的。

原来是idea的kotlin插件版本比pom中的低。

三、解决思路:

把项目里面的版本降一下

一种是升级下idea插件的版本

四、解决办法:

升级Kotlin版本有两种方法步骤如下:

然后清除缓存重启,问题解决;

总结:原因为idea版本旧默认的kotlin版本低,与当前springboot里的ketlin版本冲突导致

相关推荐
Mahir087 小时前
Spring 循环依赖深度解密:从问题本质到三级缓存源码级解析
java·后端·spring·缓存·面试·循环依赖·三级缓存
RyFit8 小时前
SpringAI 常见问题及解决方案大全
java·ai
石山代码8 小时前
C++ 内存分区 堆区
java·开发语言·c++
绝知此事9 小时前
【算法突围 01】线性结构与哈希表:后端开发的收纳术
java·数据结构·算法·面试·jdk·散列表
无风听海9 小时前
C# 隐式转换深度解析
java·开发语言·c#
一只大袋鼠9 小时前
Git 进阶(二):分支管理、暂存栈、远程仓库与多人协作
java·开发语言·git
德思特10 小时前
从 Dify 配置页理解 RAG 的重要参数
java·人工智能·llm·dify·rag
YOU OU10 小时前
Spring IoC&DI
java·数据库·spring
один but you11 小时前
从可变参数到 emplace:现代 C++ 性能优化的核心组合
java·开发语言
是码龙不是码农11 小时前
ThreadPoolExecutor 7 个核心参数详解
java·线程池·threadpool