2

I have downloaded SBT to build a scala project on a Windows 64 bit computer and tried to start SBT. However, I immediately get the following crash (no other output) when entering "sbt" at the prompt (I am in Windows terminal mode):

java.io.IOException: The system cannot find the path specified
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(Unknown Source)
        at xsbt.boot.Locks$.apply0(Locks.scala:34)
        at xsbt.boot.Locks$.apply(Locks.scala:28)
        at xsbt.boot.Update.apply(Update.scala:100)
        at xsbt.boot.Launch.update(Launch.scala:350)
        at xsbt.boot.Launch$$anonfun$jansiLoader$1.apply(Launch.scala:178)
        at scala.Option.getOrElse(Option.scala:120)
        at xsbt.boot.Launch.jansiLoader$2f324eef(Launch.scala:173)
        at xsbt.boot.Launch.<init>(Launch.scala:150)
        at xsbt.boot.Launcher$.apply(Launch.scala:364)
        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)
Error during sbt execution: java.io.IOException: The system cannot find the path specified

It finds and runs SBT, but Which path does it try to find? It does not matter in which directory I am starting SBT (i.e. if the directory contains a project to build or not)

I have tried with a clean system (new installed eclipse Luna with scala IDE, latest java JDK1.8.0_73) and tried to install SBT 0.13.11 directly from an msi file as well as manually (I do not use the SBT bundled in scala IDE). No difference. SBT won't start. And no hint on which path it is looking for. What can be the cause for this?

Pontus
  • 43
  • 6
  • You could try `activator` instead : https://www.lightbend.com/community/core-tools/activator-and-sbt It is more or less sbt with some usability features added. – Andreas Neumann Mar 01 '16 at 16:21
  • Does this problem also occur when you try to start sbt inside a minimal directory with just a blank `build.sbt`? Seems it is trying to create a file whose parent directory does not exist. You could also try to wipe `~/.sbt`, perhaps something went wrong and was left in a bad state? Just guessing – 0__ Mar 01 '16 at 20:13
  • Tried both proposals: Activator tries to start sbt: same crash again. – Pontus Mar 02 '16 at 08:23
  • Second proposal: same crash in minimal directory with blank "build.sbt". Also when deleting ".sbt". A new ".sbt" is created every time when sbt tries to start, containing a directory "boot" with one always empty directory "resolution-cache" and one always empty file "update.log". Is there some way to get a log out of sbt when it tries to boot? It never gets up-and-running, however. – Pontus Mar 02 '16 at 08:29
  • Eventually, I managed to fix it... See [link](http://stackoverflow.com/questions/34030975/configure-sbt-to-not-utilize-user-home-directory). It had to do with ivy. I had an (empty) _file_ (not a directory) ".ivy2" in my home directory. SBT tried to write in an (assumed already existing) ".ivy2" _directory_. This directory was never created during sbt installation (probably because there were already a file there with that name). Manually removing the ".ivy2" file and creating a directory with the same name fixed it. How the _file_ ended up there in the first place is a mystery... – Pontus Mar 02 '16 at 12:31
  • My solution was a bit different. Figured I'd mention it here for anyone googling in the future... I'm on Win7 x64 w/ corporate firewall (using activatorconfig.txt + sbt\conf\sbtconfig.txt) w/ following versions rolled out to my machine: scala v2.11.8 and activator using sbt launcher 0.13.5. Was getting exact same error as OP but my .ivy2 folder was fine. Ended up using sysinternals procmon to spy on the java.exe used when launching activator and found that it wanted a 'Java' subfolder under the project when it created a log file; created the dir and it worked fine. prolly a one-off setup issue – zpangwin Jan 04 '17 at 22:20

0 Answers0