When building Scala(2.7.0) maven project getting error "error while loading Consumer" with Java 8 in IntelliJ

huangapple go评论73阅读模式
英文:

When building Scala(2.7.0) maven project getting error "error while loading Consumer" with Java 8 in IntelliJ

问题

在构建Scala的Maven项目时出现错误:

错误信息:

error while loading Consumer, class file 'C:\jdk1.8.0_181\jre\lib\rt.jar(java/util/function/Consumer.class)' is broken
英文:

When building Scala maven project getting error:

error while loading Consumer, class file 'C:\jdk1.8.0_181\jre\lib\rt.jar(java/util/function/Consumer.class)' is broken

答案1

得分: 1

在搜索后找到了这个链接(https://github.com/jboner/akka-training/issues/1),其中指出:

有两种解决方法:

选项1:使用Java 7与Scala 2.7.2

选项2:使用另一个版本的Scala(2.11.4)和Java 8:

我尝试了选项2并升级了Scala版本到2.12.0,这对我起作用。

英文:

After searching find out this link(https://github.com/jboner/akka-training/issues/1) which states:

There are two ways to solve it:

Option 1: Using java 7 with scala 2.7.2

Option 2: Using another version of scala (2.11.4), and java 8:

I tried option-2 and upgraded Scala version to 2.12.0, it worked for me.

huangapple
  • 本文由 发表于 2020年4月3日 22:42:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/61014375.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定