Warning message running Play 2.5.x

2019-02-08 03:43发布

问题:

Whenever I run my application with activator run I get the following warning:

"The system cannot find the file BIN_DIRECTORY\..\conf\sbtconfig.txt"

What does this message mean? Should I create this file? The application works fine.

回答1:

@ps0604 Firstly, you should follow James Higgins-Thomas's 2nd answer and edit the C:\your\path\to\activator-dist-1.3.10\bin\activator.bat file and add a closing % symbol

set SBT_HOME=%BIN_DIRECTORY%

Secondly, the sbtconfig.txt found in the Scala directory C:\Program Files\sbt\conf\ needs to be copied to C:\your\path\to\activator-dist-1.3.10\conf. The google posting is from 2013 - so I think it's a bit dated

Mind you, I think that it's odd that the SBT_HOME variable would point to a directory in Activator. It might be better to have

set SBT_HOME="c:\Program Files\sbt\"

(I know it's hard coded - not the best)

And then fix

set FN="%SBT_HOME%\conf\sbtconfig.txt"


回答2:

Fix activator.bat

In addition to fixing the missing % after %BIN_DIRECTORY

set SBT_HOME=%BIN_DIRECTORY%

I also had to add quotes arround it in

for %%D in ("%BIN_DIRECTORY%") do

I put all my java in Program Files which contains a space..... The old drama still around every now an then....

But now it starts :)

[info] play - Application started (Prod)
[info] play - Listening for HTTP on /127.0.0.1:8888
[info] a.e.s.Slf4jLogger - Slf4jLogger started


回答3:

@Haim Raman. Or you could just leave the set SBT_HOME=%BIN_DIRECTORY% and rather define your sbtconfig.txt file location in the same activator.bat file.

i.e. pathToactivatorfolder/bin/activator.bat

So let's say if your activator is installed in "C:\activator" you do that by changing the line:
set FN=%SBT_HOME%..\conf\sbtconfig.txt.

To : set FN=%SBT_HOME%\..\..\pathTosbtfolder\conf\sbtconfig.txt

So let's say if your sbt is installed in "C:\Program Files (x86)\sbt" (remember activator is installed in "C:\activator")

then your settings will look like this:
set FN=%SBT_HOME%\..\..\Program Files (x86)\sbt\conf\sbtconfig.txt
Note that \..\..\ just means going up two directories. So you can always define your sbtconfig.txt location relative to your activator install path.