7

I am having troubles launching a standalone play application as a Java process on Windows. I use the "play dist" command in order to generate a zip file containing all the jars that are necessary for the application to run. The zip file also contains the "start" file that contains a script that is supposed to launch the application (works fine on Linux server).

I found the sbtgoodies plugin with the "play dist-unzip" command https://github.com/typesafehub/play-plugins/tree/master/sbtgoodies. It works fine but I always get a unix script "start". How can I get a windows script "start.bat"?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
user431015
  • 103
  • 2
  • 8

2 Answers2

15

The start.bat with the following command line should work :

java %1 -cp "./lib/*;" play.core.server.NettyServer .

Note the ";" after lib/* to prevent Windows preprocessor from expanding the wildcard

Axelle Ziegler
  • 2,505
  • 17
  • 19
  • Where do you put this start.bat? –  Feb 21 '13 at 16:33
  • 1
    at the root of the folder generated by dist-unzip. But you can put it wherever you want and adjust "./lib:*;" to point to your lib directory – Axelle Ziegler Feb 23 '13 at 00:15
  • This works but stops working when I try and add -D java parameters like "java %1 -Dconfig.file=application-prod.conf -cp "./lib/*;" play.core.server.NettyServer ." – disperse May 16 '16 at 15:04
0

it looks like your classpath property is different. Have you tried with -cp "staged/*"

emt14
  • 4,846
  • 7
  • 37
  • 58