我正在尝试学习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