【问题标题】:sbt 1.2.8 throwing error in non sudo mode (fedora)sbt 1.2.8 在非 sudo 模式下抛出错误(fedora)
【发布时间】: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 的相同问题(如果有)

标签: scala sbt fedora


【解决方案1】:

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

我不知道那个文件夹里发生了什么,所以最好先做一个备份。删除后我重新运行sbt,文件夹又出现了,但是sbt不再crash了。

【讨论】:

    猜你喜欢
    • 2019-06-17
    • 2016-12-23
    • 2021-06-28
    • 2015-02-04
    • 1970-01-01
    • 2021-06-24
    • 2020-03-26
    • 1970-01-01
    • 2013-10-20
    相关资源
    最近更新 更多