2

我正在尝试在 Play 2.6 中创建一个新的 scala 种子项目。从 play 的网站上,我可以看到他们放弃了使用 activator 并切换到 sbt 命令。

即使我在 Windows 上运行 SBT,我也会收到“找不到 bash”文件的消息(见下文)。任何帮助将不胜感激。

我安装了 SBT 1.0.4 版。

C:\test>sbt new playframework/play-scala-seed.g8
"C:\Users\pablo\.sbt\preloaded\org.scala-sbt\sbt\"1.0.4"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Set current project to test (in build file:/C:/test/)
10:29:52.037 [main] ERROR org.eclipse.jgit.util.FS - Caught exception in FS.readPipe()
java.io.IOException: Cannot run program "bash" (in directory "C:\Users\pablo"): CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(Unknown Source) ~[?:1.8.0_151]
        at java.lang.Runtime.exec(Unknown Source) ~[?:1.8.0_151]
        at org.eclipse.jgit.util.FS.readPipe(FS.java:431) ~[?:?]
        at org.eclipse.jgit.util.FS_Win32.discoverGitPrefix(FS_Win32.java:113) ~[?:?]
        at org.eclipse.jgit.util.FS.gitPrefix(FS.java:517) ~[?:?]
        at org.eclipse.jgit.util.SystemReader$Default.openSystemConfig(SystemReader.java:92) ~[?:?]
        at org.eclipse.jgit.internal.storage.file.FileRepository.<init>(FileRepository.java:171) ~[?:?]
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilder.java:577) ~[?:?]
        at org.eclipse.jgit.api.InitCommand.call(InitCommand.java:113) ~[?:?]
        at org.eclipse.jgit.api.CloneCommand.init(CloneCommand.java:161) ~[?:?]
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:132) ~[?:?]
        at giter8.JgitHelper$.clone(JgitHelper.scala:116) ~[?:?]
        at giter8.JgitHelper$.run(JgitHelper.scala:67) ~[?:?]
        at giter8.JgitHelper$.run(JgitHelper.scala:80) ~[?:?]
        at giter8.Giter8.$anonfun$run$2(giter8.scala:34) ~[?:?]
        at scala.Option.map(Option.scala:146) ~[scala-library.jar:1.0.2]
        at giter8.Giter8.run(giter8.scala:33) ~[?:?]
        at sbtgiter8resolver.Giter8TemplateResolver.run(Giter8TemplateResolver.scala:31) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_151]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_151]
        at sbt.TemplateCommandUtil$.call(TemplateCommand.scala:93) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.TemplateCommandUtil$.runTemplate(TemplateCommand.scala:71) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.TemplateCommandUtil$.$anonfun$run$1(TemplateCommand.scala:51) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.TemplateCommandUtil$.$anonfun$run$1$adapted(TemplateCommand.scala:47) ~[main_2.12-1.0.4.jar:1.0.4]
        at scala.collection.LinearSeqOptimized.find(LinearSeqOptimized.scala:111) ~[scala-library.jar:1.0.2]
        at scala.collection.LinearSeqOptimized.find$(LinearSeqOptimized.scala:108) ~[scala-library.jar:1.0.2]
        at scala.collection.immutable.List.find(List.scala:86) ~[scala-library.jar:1.0.2]
        at sbt.TemplateCommandUtil$.run(TemplateCommand.scala:47) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.TemplateCommandUtil$.runTemplate(TemplateCommand.scala:34) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.TemplateCommandUtil$.$anonfun$templateCommand$2(TemplateCommand.scala:17) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.Command$.$anonfun$applyEffect$4(Command.scala:125) ~[command_2.12-1.0.4.jar:1.0.4]
        at sbt.Command$.$anonfun$applyEffect$2(Command.scala:121) ~[command_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.processCommand(MainLoop.scala:121) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:105) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.State$$anon$1.runCmd$1(State.scala:227) ~[command_2.12-1.0.4.jar:1.0.4]
        at sbt.State$$anon$1.process(State.scala:233) ~[command_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:105) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16) ~[util-control_2.12-1.0.3.jar:1.0.3]
        at sbt.MainLoop$.next(MainLoop.scala:105) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.run(MainLoop.scala:98) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:76) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.io.Using.apply(Using.scala:22) ~[io_2.12-1.0.2.jar:1.0.2]
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:70) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:52) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:37) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.MainLoop$.runLogged(MainLoop.scala:29) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.StandardMain$.runManaged(Main.scala:104) ~[main_2.12-1.0.4.jar:1.0.4]
        at sbt.xMain.run(Main.scala:71) ~[main_2.12-1.0.4.jar:1.0.4]
        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:41) ~[?:?]
        at xsbt.boot.Boot$.main(Boot.scala:17) ~[?:?]
        at xsbt.boot.Boot.main(Boot.scala) ~[?:?]
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method) ~[?:1.8.0_151]
        at java.lang.ProcessImpl.<init>(Unknown Source) ~[?:1.8.0_151]
        at java.lang.ProcessImpl.start(Unknown Source) ~[?:1.8.0_151]
        ... 59 more
4

3 回答 3

0

在 Windows 中,您需要使用 sbt.bat 而不是 sbt(用于 *nix 系统)。

https://github.com/playframework/playframework/issues/7768

同样如本期所述,请尝试将https://dl.bintray.com/的证书添加到 java 密钥库。java keystore位置是里面的cacerts文件jdk_version\jre\security\

于 2017-12-04T16:24:41.487 回答
0

看起来很老的问题:这是因为您的本地没有安装git bash 。一旦你安装了 git(见这里的安装程序),这个错误就会消失。

于 2019-03-28T21:12:12.343 回答
-1

正如这里所讨论的,您需要sbt.bat在 Windows 中使用:

sbt.bat new playframework/play-scala-seed.g8
于 2018-02-07T06:47:50.950 回答