sbt-java.io.FileNotFoundException

sbt-java.io.FileNotFoundException

sbt按照此说明进行安装入门 - 设置,在 Ubuntu 12.04 上。

当我运行时sbt,我看到下一个输出:

nazar_art@nazar-desctop:~$ sbt
java.io.FileNotFoundException: /home/nazar_art/.sbt/boot/update.log (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
    at java.io.FileWriter.<init>(FileWriter.java:90)
    at xsbt.boot.Update.<init>(Checks.java:51)
    at xsbt.boot.Launch.update(Launch.scala:275)
    at xsbt.boot.Launch$$anonfun$jnaLoader$1.apply(Launch.scala:120)
    at scala.Option.getOrElse(Option.scala:108)
    at xsbt.boot.Launch.jnaLoader$2f324eef(Launch.scala:115)
    at xsbt.boot.Launch.<init>(Launch.scala:94)
    at xsbt.boot.Launcher$.apply(Launch.scala:290)
    at xsbt.boot.Launch$.apply(Launch.scala:16)
    at xsbt.boot.Boot$.runImpl(Boot.scala:31)
    at xsbt.boot.Boot$.main(Boot.scala:20)
    at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.io.FileNotFoundException: /home/nazar_art/.sbt/boot/update.log (No such file or directory)
nazar_art@nazar-desctop:~$ sudo sbt
[sudo] password for nazar_art: 
Error occurred during initialization of VM
Could not reserve enough space for object heap

为了完全确认,我重复一下可执行脚本:

nazar_art@nazar-desctop:~$ chmod u+x ~/bin/sbt
nazar_art@nazar-desctop:~$ which sbt
/home/nazar_art/bin/sbt

更新:

update.log不存在。我创建于~/bin/.sbt/boot/update.log

现在当我尝试运行时sbt我看到输出:

nazar_art@nazar-desctop:~/bin/.sbt/boot$ sbt
No command 'sbt' found, did you mean:
 Command 'skt' from package 'latex-sanskrit' (main)
 Command 'sb2' from package 'scratchbox2' (universe)
 Command 'sbd' from package 'cluster-glue' (main)
 Command 'mbt' from package 'mbt' (universe)
 Command 'sbmt' from package 'atfs' (universe)
 Command 'lbt' from package 'lbt' (universe)
 Command 'st' from package 'suckless-tools' (universe)
 Command 'sb' from package 'lrzsz' (universe)

更新:

update.log我准确移动了这个文件home/nazar_art/.sbt/boot 但是运行之后sbt我得到了相同的结果,但是Permission denied

nazar_art@nazar-desctop:~/.sbt/boot$ pwd
/home/nazar_art/.sbt/boot
nazar_art@nazar-desctop:~/.sbt/boot$ ls 
update.log
nazar_art@nazar-desctop:~/.sbt/boot$ sbt
java.io.FileNotFoundException: /home/nazar_art/.sbt/boot/update.log (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
    at java.io.FileWriter.<init>(FileWriter.java:90)
    at xsbt.boot.Update.<init>(Checks.java:51)
    at xsbt.boot.Launch.update(Launch.scala:266)
    at xsbt.boot.Launch$$anonfun$jnaLoader$1.apply(Launch.scala:111)
    at scala.Option.getOrElse(Option.scala:108)
    at xsbt.boot.Launch.jnaLoader$2f324eef(Launch.scala:106)
    at xsbt.boot.Launch.<init>(Launch.scala:85)
    at xsbt.boot.Launcher$.apply(Launch.scala:281)
    at xsbt.boot.Launch$.apply(Launch.scala:16)
    at xsbt.boot.Boot$.runImpl(Boot.scala:31)
    at xsbt.boot.Boot$.main(Boot.scala:20)
    at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.io.FileNotFoundException: /home/nazar_art/.sbt/boot/update.log (Permission denied)

- 为什么会发生这种情况?
- 如何解决这个问题?

答案1

您应该检查以确保该文件~/.sbt/boot存在。如果不存在,那么您可能需要创建它。如果存在,请尝试touch ~/.sbt/boot/update.log以您的用户身份执行以创建该文件并根据需要设置其权限。

相关内容