1

I have a Java Application written that forwards selected files to an ssh server. I want this application to be automatically run every time windows starts.

I am aware that this question has been asked multiple times, and I have followed those leads. I have tried Java Service Wrapper (which is no longer accessible because of a dns problem), Apache Daemon, and JSL. Though I have at times been able to get the application installed as a service, I have never been able to get it to run properly on boot, or even start it manually from the command line.

My question is whether anyone is aware of a full first step through final step tutorial of how to make this work. I have come across a few things, but they all either assume that you have implemented something that they do not explain how to implement, or rely on applications that I do not have installed.

Thanks

ewok
  • 20,148
  • 51
  • 149
  • 254

1 Answers1

6

I use Java Service Wrapper to install as windows or linux service: http://wrapper.tanukisoftware.com/doc/english/download.jsp

~> create one runnable JAR to your app.

~> Download the proper service wrapper (they are diffrent to windows and linux)

~> Configure the service in wrapper.conf

Important: set wrapper.java.classpath correct (your jar must be here too) Set wrapper.java.mainclass with org.tanukisoftware.wrapper.WrapperSimpleApp
Set wrapper.app.parameter.1 with the name of your main class, for example:

wrapper.app.parameter.1=Main

~> Test the service as console (windows bat)

  • Is there no more to it? do I need to implement a specific interface or something or should I be able to simply install and run the service? @Sérgio Michels – ewok Sep 08 '11 at 17:51
  • Yep, I don't implement any specific interface. Just it should be enough beacuse WrapperSimpleApp do the work. –  Sep 08 '11 at 17:56
  • Where exactly is the wrapper.conf that I need to edit? in {WRAPPER_HOME}/conf there is one, but there is also a wrapper.conf.in in {WRAPPER_HOME}/src/conf. can you explain what the *.in files are for? @Sérgio Michels – ewok Sep 08 '11 at 17:58
  • And if you want to do some specific stuff on the stop of service, add Runtime.getRuntime().addShutdownHook(). –  Sep 08 '11 at 17:58
  • @ewok, I don't know why the extension is "in" but I edit the {WRAPPER_HOME}/conf –  Sep 08 '11 at 18:01