繁体   English   中英

我意外删除了.sbt目录,如何使sbt重新运行?

[英]I deleted the .sbt directory in accident, How to make the sbt run again?

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

我将用户配置文件形式从“ something Dev”折叠迁移到“ something” fold。

当前的错误是:

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之上的任何程序(如激活程序)仍会应用旧路径。

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

在下面添加2行:

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

然后sbt和其他sbt依赖关系将找到路径

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM