play framework bat windows java process

2019-02-05 03:32发布

问题:

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"?

回答1:

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



回答2:

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