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

房东的猫 提交于 2021-01-28 07:40:22

问题


I have a new Kotlin project in Eclipse (I installed the kotlin plugin). However this code:

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

causes this error:

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

What is the source of this error? How can I fix it?

I have seen the other posts on stackoverflow but they all talk about intellij and not Eclipse.


回答1:


I got this error while using kotlin in eclipse. In my system, JDK was not installed previously. I installed JDK 15 in the PC and set the path in kotlin plugin settings in eclipse (path: Window -> preferences -> Kotlin -> Compiler -> JDK Home)



来源:https://stackoverflow.com/questions/64527844/cannot-access-java-io-serializable-which-is-a-supertype-of-kotlin-string-ch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!