sbt 1.2.8在非sudo模式下抛出错误(fedora)

时间:2019-02-21 15:05:17

标签: scala sbt fedora

我已按照以下说明在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版本也可以解决该问题,但这不是一个长期解决方案。

你知道发生了什么吗?

1 个答案:

答案 0 :(得分:1)

这不是一个特别令人满意的答案,但是我能够通过删除〜/ .sbt文件夹来解决此问题(同样在Fedora 29上)

我不知道该文件夹中发生了什么,因此最好先进行备份。删除后,我重新运行sbt并重新出现该文件夹,但sbt不再崩溃。