【发布时间】:2019-07-15 13:12:26
【问题描述】:
我按照以下说明在 Fedora 29 上安装了 sbt 1.2.8: https://www.scala-sbt.org/1.0/docs/Installing-sbt-on-Linux.html
当我运行 sbt 时(不管是在项目文件夹还是任何其他地方),我得到:
java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
at sbt.xMain.run(Main.scala:74)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:56)
at xsbt.boot.Boot$.main(Boot.scala:18)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
使用 sudo 权限运行 sbt 可以解决问题。我也试过从 sbt 站点下载 tgz 包并运行
./bin/sbt
但结果相同(非 sudo - 错误 / sudo - 一切正常)。 降级到 1.2.7 版本也解决了这个问题,但这不是一个长期的解决方案。
你知道发生了什么吗?
【问题讨论】:
-
两个用户下的 Java 版本是否相同?
java -version。 JAVA_HOME 的相同问题(如果有)