检查您的模块类路径是否缺少或冲突的依赖项(科特琳月食)

时间:2019-12-05 10:16:37

标签: eclipse kotlin hashmap hashset

我正在尝试学习kotlin,当我运行任何包含HashMap或HashSet的示例程序时,我得到以下错误(我正在eclipse中运行示例)。其他不涉及任何Collection的程序都可以正常工作。

示例:

val readWriteMap = hashMapOf("foo" to 1, "bar" to 2)
    println(readWriteMap["foo"])  

    val strings = hashSetOf("a", "b", "c", "c")
    println("My Set Values are" + strings)

ERROR: Cannot access class 'java.util.HashMap'. Check your module classpath for missing or conflicting dependencies

ERROR: Cannot access class 'java.util.HashSet'. Check your module classpath for missing or conflicting dependencies

0 个答案:

没有答案