Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java IntelliJ IDEA 13 Scala插件&;Eclipse开普勒编译错误_Java_Eclipse_Scala_Intellij Idea_Guava - Fatal编程技术网

Java IntelliJ IDEA 13 Scala插件&;Eclipse开普勒编译错误

Java IntelliJ IDEA 13 Scala插件&;Eclipse开普勒编译错误,java,eclipse,scala,intellij-idea,guava,Java,Eclipse,Scala,Intellij Idea,Guava,代码: 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.toIte

代码:

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)
}
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 -> 0.26.318
Version: 0.26.318
Date: 2013-12-04 10:46
Since: 133.124
Until: 134.0
Size: 25346.32 Kb
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
IntelliJ IDEA错误:

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)
}
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 -> 0.26.318
Version: 0.26.318
Date: 2013-12-04 10:46
Since: 133.124
Until: 134.0
Size: 25346.32 Kb
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
Scala插件版本:

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)
}
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 -> 0.26.318
Version: 0.26.318
Date: 2013-12-04 10:46
Since: 133.124
Until: 134.0
Size: 25346.32 Kb
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
Eclipse错误:

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)
}
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 -> 0.26.318
Version: 0.26.318
Date: 2013-12-04 10:46
Since: 133.124
Until: 134.0
Size: 25346.32 Kb
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语言编写了一个程序

我使用带有Scala插件的Eclipse IDE和带有Scala插件的IntelliJ IDEA时上面显示了错误,我无法编译它


有人能帮我吗?

这不是IDE的错。事实上,Scala编译器就是这样工作的。与Java编译器不同,Scala编译器需要代码直接使用的所有库的所有注释。Guava依赖于JSR-305注释,所以您必须在构建中包含相应的JAR

有关更多信息,请参阅和。这是Maven依赖项描述符,复制自:


com.google.code.findbugs
jsr305
2.0.2

您使用的JDK8还没有正式发布,您确定这不是与+Scala不兼容的问题吗?请确保您已升级了Scala插件。scala插件没有与IDEA捆绑在一起,因此在从IDEA 12升级到IDEA 13后必须手动更新。我更新了我的帖子,请查看新信息其他Guava类工作正常吗?如果使用ApacheCommons而不是Guava,并使用StringJoiner,会发生什么呢?谢谢,是的,现在可以工作了:D