【发布时间】:2013-12-21 06:33:20
【问题描述】:
代码:
import com.google.common.base.Joiner
import scala.collection.JavaConverters._
object MainJ extends App {
val fantasyGeneres = Array("Space Opera", "Horror", "Magic realism", "Religion")
val joined = Joiner.on(',').join(fantasyGeneres.toIterable.asJava)
println(joined)
}
IntelliJ IDEA 错误:
scala: error while loading Joiner, class file 'C:\guava- 15.0.jar(com/google/common/base/Joiner.class)' is broken
(class java.lang.RuntimeException/bad constant pool tag 9 at byte 10)
Scala 插件版本:
Scala -> 0.26.318
Version: 0.26.318
Date: 2013-12-04 10:46
Since: 133.124
Until: 134.0
Size: 25346.32 Kb
Eclipse 错误:
Description Resource Path Location Type
error while loading Joiner, class file 'C:\guava-15.0.jar(com/google/common/base/Joiner.class)' is broken (class java.lang.RuntimeException/bad constant pool tag 9 at byte 10) Scala Unknown Scala Problem
请看上面的图片,我用 Guava 库和 scala 语言编写了一个程序
何时我使用 Eclipse IDE with Scala Plugin 和 IntelliJ IDEA with Scala Plugin 上面的错误显示我无法编译它
谁能帮帮我?
【问题讨论】:
-
您使用的是尚未正式发布的JDK8,您确定这不是与那个+Scala不兼容的问题吗?
-
确保你已经升级了scala插件。 scala 插件未与 IDEA 捆绑,因此从 IDEA 12 升级到 13 后必须手动更新。
-
我更新了我的帖子,请查看新信息
-
其他 Guava 类是否正常工作?如果你包含 Apache Commons 而不是 Guava 并使用它的 StringJoiner 会发生什么?
标签: java eclipse scala intellij-idea guava