我意外删除了.sbt目录,如何让sbt再次运行?

时间:2013-11-29 04:38:05

标签: windows scala sbt

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

我将用户个人资料表单“dev”折叠为“某事”折叠。

当前错误是:

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参数来制定规范,但是默认路径不会改变,并且像激活器这样的sbt之上的任何程序仍然应用旧路径。

1 个答案:

答案 0 :(得分: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依赖将找到路径