当前位置: 代码网 > it编程>编程语言>Java > 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 ...

2024年07月28日 Java 我要评论
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 c


一、场景

1、idea编译java文件报错


二、报错信息

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

在这里插入图片描述

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com