1

I have a standalone Java application which will run continuously post start-up (e.g. java com.<mycompany>.FooServer) on a Windows EC2 instance.

Currently I have started this from a command shell. How do I make sure that it runs on a re-boot, should I be wrapping this into a Windows service? What is the easiest way to handle start/stop of my standalone server?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
priya
  • 24,861
  • 26
  • 62
  • 81
  • check out http://stackoverflow.com/questions/68113/how-to-create-a-windows-service-from-java-app - Is this not a duplicate? – Michael Wiles Nov 28 '11 at 12:01

1 Answers1

3

Create a .bat file to hold your Java command and create a Windows service using

sc create FooServerService binPath= C:\path\to\start.bat start= auto DisplayName= "My Foo Service"

adarshr
  • 61,315
  • 23
  • 138
  • 167