【问题标题】:Cannot access 'java.io.Serializable' which is a supertype of 'kotlin.String'. Check your module classpath for missing or conflicting dependencies无法访问“kotlin.String”的超类型“java.io.Serializable”。检查您的模块类路径是否存在缺失或冲突的依赖项
【发布时间】:2021-07-06 13:33:41
【问题描述】:

我在 Eclipse 中有一个新的 Kotlin 项目(我安装了 kotlin 插件)。 但是这段代码:

   val a: Int = 10000
   println("Your Int Value is "+a);

导致此错误:

ERROR: Cannot access 'java.io.Serializable' which is a supertype of 'kotlin.String'. Check your module classpath for missing or conflicting dependencies.

这个错误的根源是什么?我该如何解决?

我看过 stackoverflow 上的其他帖子,但他们都在谈论 intellij 而不是 Eclipse。

【问题讨论】:

  • 可能你的项目结构没有正确指定sdk,进入file->project structure->edit sdk

标签: eclipse kotlin


【解决方案1】:

在 Eclipse 中使用 kotlin 时出现此错误。在我的系统中,以前没有安装 JDK。我在PC中安装了JDK 15并在eclipse中的kotlin插件设置中设置了路径(路径:Window -> preferences -> Kotlin -> Compiler -> JDK Home)

【讨论】:

  • 这里是 IntelliJ 用户。使用相同的解决方案有相同的错误。不管你的 IDE 是什么,这是一个 JDK 编译错误 :) 希望这对使用 IntelliJ IDEA、Android Studio 和 Netbeans 的人也有帮助。
猜你喜欢
  • 2023-03-25
  • 1970-01-01
  • 1970-01-01
  • 2018-10-22
  • 2019-07-01
  • 1970-01-01
  • 2023-01-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多