I had made a simple java program of screen capture I want to run that program as a window service but I had trouble im not able to find the right way I had used WinRun4J but at the time of starting the service, I got an error that error 1053 the service didn't respond to start and control service. plz, help with a simple third party which is not complicated to start with im doing this first time?
Asked
Active
Viewed 146 times
1 Answers
0
You can wrap it with a batch file (.bat
) and have that batch file as a service.
Gradle eill do it out of the box for you using distribution
plug-in.

Guy Yafe
- 991
- 1
- 8
- 26
-
but how can i stop. bat file because it's a screen capture application – Ramanand Jha Aug 05 '17 at 10:17
-
it will capture screen in every 10sec – Ramanand Jha Aug 05 '17 at 10:25
-
I't not sure what so you mean by screen capture: Autmoatically Periodically? By some key stroke? The Windows service only runs the program. It is your responsibility to design the code to work as you want. – Guy Yafe Aug 05 '17 at 10:32
-
screen capture means complete ScreenCapure automatically in every 10 sec – Ramanand Jha Aug 05 '17 at 11:01
-
Note that this kind of process will consume a lot of memory and storgae. You can either stop the service manually, or listen to a keystroke. However, looks like that you are asking for a lot of functionality that is Windows specific. Thus, it seems that it is better for you to work with C# which contains better API for this kind of tasks. – Guy Yafe Aug 05 '17 at 11:20
-
why would I change the language as im working in java only – Ramanand Jha Aug 08 '17 at 04:58
-
You shouldn't "work in XXX only". You need to use the most suitable solution to your problem. If your problem is creating an application that extremely uses Windows API, then a programming environment that easily exposes this API is the correct solution. – Guy Yafe Aug 08 '17 at 11:29
-
that is only my question which API or third party service – Ramanand Jha Aug 08 '17 at 11:47