-
Install Play, if necessary.
Make sure that you can run your application from a command prompt with "sbt run". That's a prerequisite before getting AlwaysUp involved.
For this tutorial, we created a simple Java-based application that returns a simple acknowledgement to the browser:
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to the sbt.bat.
If you installed sbt in the default location, this is:
C:\Program Files (x86)\sbt\bin\sbt.bat
-
In the Arguments field, enter run.
-
In the Start in directory field, enter the folder containing your Play application.
-
In the Start the application field, select Automatically, but shortly after the computer boots.
That tells AlwaysUp to launch Play 1-2 minutes after a reboot — after critical Windows Services
(such as event logging and networking) have fully initialized and are ready to go.
-
And in the Name field, enter the name that you will call the application in AlwaysUp.
We have entered Play App but you can specify almost anything you like:
-
Move to the Logon tab and enter the user name and password of the Windows account in which you installed and
run your Play application. Java and sbt may need to run in this account to find your environment variables and other settings:
-
Switch to the Startup tab and check the Ensure that the Windows Networking components have started box.
This informs AlwaysUp that Play needs TCP/IP networking support to do its work:
-
Click Save. In a couple of seconds, an application called Play App will show up in the AlwaysUp window.
At this point, your Play app is installed as a service. But it's not running and the state will be "Stopped":
-
To start the application from AlwaysUp, choose Application > Start "Play App". The state will change to "Running"
and after a few seconds you should be able to access your application in the browser:
-
That's it! Next time your computer boots, your Play application will start up immediately, without anyone needing to log on.
Please restart your PC now and test that the application works as expected after Windows comes back to life.
And please feel free to edit your configuration in AlwaysUp to check out the many other settings that may be appropriate for your environment.
For example,
send email alerts,
establish a weekly restart to cure memory leaks,
set up a network health check, etc.