0

我想根据此处的文档通过 sbt 方式设置 scala 脚本。
执行时遇到错误 java -Dsbt.main.class=sbt.ScriptMain -Dsbt.boot.directory=/home/user/.sbt/boot -jar sbt-launch.jar "$@"

错误信息:

Getting org.scala-sbt sbt 1.0.0 ...
:: retrieving :: org.scala-sbt#boot-app
    confs: [default]
    69 artifacts copied, 0 already retrieved (21983kB/69ms)
Getting Scala 2.12.3 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    5 artifacts copied, 0 already retrieved (19004kB/48ms)
[error] java.lang.RuntimeException: No script file specified
[error]     at scala.sys.package$.error(package.scala:27)
[error]     at sbt.internal.Script$.$anonfun$command$3(Script.scala:24)
[error]     at scala.Option.getOrElse(Option.scala:121)
[error]     at sbt.internal.Script$.$anonfun$command$1(Script.scala:23)
[error]     at sbt.Command$.$anonfun$command$2(Command.scala:79)
[error]     at sbt.MainLoop$.processCommand(MainLoop.scala:121)
[error]     at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:105)
[error]     at sbt.State$$anon$1.runCmd$1(State.scala:228)
[error]     at sbt.State$$anon$1.process(State.scala:234)
[error]     at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:105)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
[error]     at sbt.MainLoop$.next(MainLoop.scala:105)
[error]     at sbt.MainLoop$.run(MainLoop.scala:98)
[error]     at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:76)
[error]     at sbt.io.Using.apply(Using.scala:23)
[error]     at sbt.MainLoop$.runWithNewLog(MainLoop.scala:70)
[error]     at sbt.MainLoop$.runAndClearLast(MainLoop.scala:52)
[error]     at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:37)
[error]     at sbt.MainLoop$.runLogged(MainLoop.scala:29)
[error]     at sbt.StandardMain$.runManaged(Main.scala:104)
[error]     at sbt.ScriptMain.run(Main.scala:82)
[error]     at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error]     at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error]     at xsbt.boot.Launch$.run(Launch.scala:109)
[error]     at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error]     at xsbt.boot.Launch$.launch(Launch.scala:117)
[error]     at xsbt.boot.Launch$.apply(Launch.scala:18)
[error]     at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error]     at xsbt.boot.Boot$.main(Boot.scala:17)
[error]     at xsbt.boot.Boot.main(Boot.scala)
[error] No script file specified
[error] Use 'last' for the full log.

我不确定 show 是否-Dsbt.main.class=sbt.ScriptMain意味着。

该文件也令人困惑:

将根据 Setup 设置的标准 sbt 脚本复制为 scalas 和 screpl(或任何您喜欢的名称)。

什么是标准的 sbt 脚本

scalas 是脚本运行器,应该使用 sbt.ScriptMain 作为主类

在哪里sbt.ScriptMain或如何定义它?

4

0 回答 0