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
  • 163,965
  • 36
  • 203
  • 405
priya
  • 19,365
  • 24
  • 59
  • 76
  • 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
  • 57,189
  • 21
  • 133
  • 158