Last time, my friend asked me to do some research for changing our existing java application from a bat file into a windows service. He already try to done that, but the service always returning message something like “failed to start”.
So this is my quick tips to after i research for a while.
First of all, please download this library, and extract it.
What you have to know first is what kind of type your application need.
Wrapper lib separated service types into :
For further information about those types, you can read here
Let say your application services type belong to ‘WrapperSimpleApp’.
Now open the configuration file with your preferred editor which is located under ‘conf’ folder.
What you have to do is change this properties :
wrapper.java.mainclass = org.tanukisoftware.wrapper.<one of your service type>
At this point you will tell the wrapper what is your application service type that you want to use.
At this point you need to inform the wrapper what and where are the library needed by the application. you can add another useful library for your application at there.
Now let tell the wrapper what is your main class
Named your console application, service name and also service description. Trust me it will make easier for you when you search your service at your OS service list
Another thing that you should need to consider, is there any service dependency at your application?
I was created the printer server application, client could send message to the server and print it by sending some message into my application. so in this case, i should include.
Now go to your wrapper/bin directory and run ‘InstallTestWrapper-NT.bat’
After it Installed successfully, run ‘StartTestWrapper-NT.bat’.
Now your application already running as an operating system service, Enjoy..
Incoming search terms:
- java service wrapper tutorial (103)
- java service wrapper tutorial windows (1)
- tutorial java service wrapper (1)