我根据这篇文章Getting started用 sbt 安装了 scala 。
但是当我创建简单的启动项目Hello world时,我遇到了奇怪的输出:
nazar_art@nazar-desctop:~$ find .sbt
.sbt
.sbt/.lib
.sbt/.lib/0.12.1
.sbt/.lib/0.12.1/sbt-launch.jar
.sbt/boot
.sbt/boot/update.log
nazar_art@nazar-desctop:~$ cd hello
nazar_art@nazar-desctop:~/hello$ echo 'object Hi { def main(args: Array[String]) = println("Hi!") }' > hw.scala
bash: hw.scala: Permission denied
nazar_art@nazar-desctop:~/hello$ 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)
我不明白为什么会发生这种情况,因为我是su
。
有什么建议么。
编辑:
我用于chmod 777
update.log。但是现在当我尝试运行 sbt 时,我有:
-rwxrwxrwx 1 root root 63 Aug 13 11:17 hw.scala
nazar_art@nazar-desctop:~/hello$ sudo echo 'object Hi { def main(args: Array[String]) = println("Hi!") }' > hw.scala
nazar_art@nazar-desctop:~/hello$ sbt
Error occurred during initialization of VM
Could not reserve enough space for object heap
- 如何解决这个麻烦?