【问题标题】:I deleted the .sbt directory in accident, How to make the sbt run again?我不小心删除了 .sbt 目录,如何让 sbt 再次运行?
【发布时间】:2013-12-04 06:35:05
【问题描述】:

我的系统是windows 8,sbt版本是0.13.0,但是我猜所有window版本都有类似的问题。

我将我的用户个人资料从“something Dev”折叠迁移到“something”折叠。

当前的错误是:

C:\activator>sbt
java.io.FileNotFoundException: C:\Users\propertymode Dev\.sbt\boot\update.log (T
he system cannot find the path specified)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
    at java.io.FileWriter.<init>(FileWriter.java:90)
    at xsbt.boot.Update.<init>(Update.scala:51)
    at xsbt.boot.Launch.update(Launch.scala:279)
    at xsbt.boot.Launch$$anonfun$jansiLoader$1.apply(Launch.scala:124)
    at scala.Option.getOrElse(Option.scala:120)
    at xsbt.boot.Launch.jansiLoader$2f324eef(Launch.scala:119)
    at xsbt.boot.Launch.<init>(Launch.scala:96)
    at xsbt.boot.Launcher$.apply(Launch.scala:294)
    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)
Error during sbt execution: java.io.FileNotFoundException: C:\Users\propertymode
Dev\.sbt\boot\update.log (The system cannot find the path specified)

我的设置是:

C:\Users\property>SET
ALLUSERSPROFILE=C:\ProgramData
AMDAPPSDKROOT=C:\Program Files (x86)\AMD APP\
APPDATA=C:\Users\property\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=PROPERTYMODE
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
GDAL_DATA=C:\PostgreSQL\9.3\gdal-data
GEOS_LIBRARY_PATH=c:\python27\DLLs\geos_c.dll
HOMEDRIVE=C:
HOMEPATH=\Users\property
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_40
LOCALAPPDATA=C:\Users\property\AppData\Local
LOGONSERVER=\PROPERTYMODE
NUMBER_OF_PROCESSORS=4
OnlineServices=Online Services
OS=Windows_NT
Path=C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bi
n\x86;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Clie
nt\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\
WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Compon
ents\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Pro
gram Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program File
s (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\W
iFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x
86)\ATI Technologies\ATI.ACE\Core-Static;C:\Python27;C:\Python27\Scripts;C:\Prog
ram Files (x86)\Bitvise Tunnelier;C:\Program Files (x86)\Git\cmd;C:\Program File
s\nodejs\;C:\scala\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jd
k1.7.0_40\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS
\System32\WindowsPowerShell\v1.0\;C:\cygwin64\bin\;C:\activator\;C:\sbt\bin;C:\U
sers\property\AppData\Roaming\npm
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PCBRAND=Pavilion
Platform=BNB
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3a09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROJ_LIB=%PROJ_LIB%
PROMPT=$P$G
PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SBT_HOME=C:\sbt\
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\property\AppData\Local\Temp
TMP=C:\Users\property\AppData\Local\Temp
USERDOMAIN=propertymode
USERDOMAIN_ROAMINGPROFILE=propertymode
USERNAME=property
USERPROFILE=C:\Users\property
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
windir=C:\WINDOWS

我的 %HOMEPATH% 和 %USERPROFILE% 是:

C:\Users\property>echo %HOMEPATH%
\Users\property

C:\Users\property>echo %USERPROFILE%
C:\Users\property

我知道我可以通过设置 sbt.boot.directory 参数来制定规范,但是默认路径不会改变,并且像 activator 这样的 sbt 之上的任何程序仍会应用旧路径。

【问题讨论】:

  • 它应该会自动重新创建。 .sbt 不是 sbt 发行版的一部分 - 它是本地配置/存储。检查您是否有权以用户身份创建此结构
  • 希望路径中的空格没有问题...
  • @ajozwik 我已经将我的用户配置文件目录从“propertymode Dev”更改为“property”我检查了我的配置文件目录是否有 .sbt,如果我删除它可以重新创建,但 sbt 仍然使用默认目录“C:\User\propertymod Dev\.sbt\boot”作为它的引导目录。我不知道为什么
  • sbt 默认使用%HOMEPATH%%USERPROFILE%。我找不到哪一个。所以先检查你的系统变量。
  • @ajozwik 只是更新我的问题,两个默认变量对于 \Users\property 和 C:\User\property 是正确的

标签: windows scala sbt


【解决方案1】:

我找到了解决方法,在我的 sbt 目录中,有一个配置文件 sbtconfig.txt

在下面添加 2 行:

-Dsbt.global.base=C:\users\[your user profile]\.sbt
-Dsbt.ivy.home=C:\Users\[your user profile]\.ivy2

然后sbt和其他sbt依赖会找到路径

【讨论】:

    猜你喜欢
    • 2020-10-30
    • 2014-04-15
    • 1970-01-01
    • 2017-07-31
    • 1970-01-01
    • 1970-01-01
    • 2015-06-03
    • 1970-01-01
    • 2020-02-22
    相关资源
    最近更新 更多