在项目文件夹上抛出

在项目文件夹上抛出

本文介绍了SBT 在项目文件夹上抛出 java.io.FileNotFoundException: (Permission denied)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我想知道是否有人在尝试运行 SBT 时遇到过 java.io.FileNotFoundException.

I'm wondering whether anyone has any experience with a java.io.FileNotFoundException while trying to run SBT.

当我尝试运行 SBT 时,出现以下错误.这发生在我尝试加载项目定义时输入 sbt 之后.

When I try to get SBT running I get the error below. This happens right after I enter sbt when it tries to load the project definition.

我检查了它说它无法访问的文件,它们肯定在那里,我完全不明白它为什么要这样做.

I checked out the files that it says it can't access and they're definitely there and I'm totally stumped as to why it's doing this.

堆栈跟踪如下:

[debug] Running task... Cancelable: false, check cycles: false
java.io.FileNotFoundException: /home/blah/blah/project/target/streams/$global/compilers/$global/out (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 sbt.std.Streams$$anon$3$$anon$2$$anonfun$text$1.apply(Streams.scala:80)
    at sbt.std.Streams$$anon$3$$anon$2$$anonfun$text$1.apply(Streams.scala:80)
    at sbt.std.Streams$$anon$3$$anon$2.make(Streams.scala:91)
    at sbt.std.Streams$$anon$3$$anon$2.text(Streams.scala:80)
    at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:85)
    at sbt.std.TaskStreams$class.log(Streams.scala:31)
    at sbt.std.Streams$$anon$3$$anon$2.log(Streams.scala:69)
    at sbt.EvaluateTask$$anonfun$logIncomplete$2.log$1(EvaluateTask.scala:95)
    at sbt.EvaluateTask$$anonfun$logIncomplete$2.apply(EvaluateTask.scala:99)
    at sbt.EvaluateTask$$anonfun$logIncomplete$2.apply(EvaluateTask.scala:94)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
    at scala.collection.immutable.List.foreach(List.scala:76)
    at sbt.EvaluateTask$.logIncomplete(EvaluateTask.scala:94)
    at sbt.EvaluateTask$.logIncResult(EvaluateTask.scala:86)
    at sbt.EvaluateTask$.run$1(EvaluateTask.scala:149)
    at sbt.EvaluateTask$.runTask(EvaluateTask.scala:160)
    at sbt.EvaluateTask$$anonfun$apply$1$$anonfun$apply$3.apply(EvaluateTask.scala:84)
    at sbt.EvaluateTask$$anonfun$apply$1$$anonfun$apply$3.apply(EvaluateTask.scala:83)
    at scala.Option.map(Option.scala:133)
    at sbt.EvaluateTask$$anonfun$apply$1.apply(EvaluateTask.scala:83)
    at sbt.EvaluateTask$$anonfun$apply$1.apply(EvaluateTask.scala:82)
    at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:120)
    at sbt.EvaluateTask$.apply(EvaluateTask.scala:82)
    at sbt.EvaluateTask$.evalPluginDef(EvaluateTask.scala:69)
    at sbt.Load$$anonfun$2.apply(Load.scala:51)
    at sbt.Load$$anonfun$2.apply(Load.scala:51)
    at sbt.Load$.buildPluginDefinition(Load.scala:496)
    at sbt.Load$.buildPlugins(Load.scala:477)
    at sbt.Load$.plugins(Load.scala:465)
    at sbt.Load$.loadUnitNew(Load.scala:419)
    at sbt.Load$.loadUnit(Load.scala:410)
    at sbt.Load$$anonfun$13$$anonfun$apply$11.apply(Load.scala:252)
    at sbt.Load$$anonfun$13$$anonfun$apply$11.apply(Load.scala:252)
    at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:94)
    at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:93)
    at sbt.BuildLoader.apply(BuildLoader.scala:137)
    at sbt.Load$.loadAll(Load.scala:307)
    at sbt.Load$.loadURI(Load.scala:260)
    at sbt.Load$.load(Load.scala:256)
    at sbt.Load$.load(Load.scala:247)
    at sbt.Load$.apply(Load.scala:124)
    at sbt.Load$.defaultLoad(Load.scala:39)
    at sbt.BuiltinCommands$.doLoadProject(Main.scala:400)
    at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:394)
    at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:394)
    at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
    at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:60)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
    at sbt.Command$.process(Command.scala:90)
    at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71)
    at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71)
    at sbt.State$$anon$2.process(State.scala:170)
    at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
    at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.MainLoop$.next(MainLoop.scala:71)
    at sbt.MainLoop$.run(MainLoop.scala:64)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:53)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:50)
    at sbt.Using.apply(Using.scala:25)
    at sbt.MainLoop$.runWithNewLog(MainLoop.scala:50)
    at sbt.MainLoop$.runAndClearLast(MainLoop.scala:33)
    at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:17)
    at sbt.MainLoop$.runLogged(MainLoop.scala:13)
    at sbt.xMain.run(Main.scala:26)
    at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:57)
    at xsbt.boot.Launch$.withContextLoader(Launch.scala:77)
    at xsbt.boot.Launch$.run(Launch.scala:57)
    at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
    at xsbt.boot.Launch$.launch(Launch.scala:65)
    at xsbt.boot.Launch$.apply(Launch.scala:16)
    at xsbt.boot.Boot$.runImpl(Boot.scala:32)
    at xsbt.boot.Boot$.main(Boot.scala:21)
    at xsbt.boot.Boot.main(Boot.scala)

推荐答案

(Permission denied) 错误表明您可能正在运行来自用户的 sbt 命令没有权限用于您正在输入 sbt 的项目.

The (Permission denied) error says that you're probably running the sbt command from a user that doesn't have permission for the project you're entering sbt in.

使用 chown -R youruser:youruser/path/to/project 更改文件夹权限,它应该修复它.

Change folder permissions with chown -R youruser:youruser /path/to/project and it should fix it.

这篇关于SBT 在项目文件夹上抛出 java.io.FileNotFoundException: (Permission denied)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 22:34