小工具知识网

当前位置: 首页 > 行业知识 > IDEA编译报错:Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary ...

行业知识

IDEA编译报错:Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary ...

2026-11-01 09:22:48 来源:互联网转载

目录

    • 一、场景
    • 二、报错信息
    • 三、重现步骤
    • 四、原因
    • 五、解决

      一、场景

      1、IDEA编译Javaindex.php/tags-522.html" >文件报错


      二、报错信息

      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.15.Warning:Kotlin: Some JAR files in the classpath have the Kotlin Runtime library bundled into them. This may cause difficult to debug problems if there's a different version of the Kotlin Runtime library in the classpath. Consider removing these libraries from the classpath

      三、重现步骤

      1、先编译一遍项目

      2、将其中一个Java文件从原目录移动到其他目录

      3、再次编译


      四、原因

      1、在第一次编译后,原目录会生成class文件

      2、将Java文件从原目录移动到其他目录后再次编译,会在新目录再次生成对应的class文件,这时再原目录和新目录都会生成同样的class文件,导致冲突


      五、解决

      Rebuild Project即可,Rebuild Project会先删除先前编译的class

上一篇:苹果六怎么开启服务器?

下一篇:卡槽弹不出来怎么办?快速解决技巧大揭秘!