Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a windows service application

 
Sanath sajjan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I am trying to create an windows application, and then i have to run it as a windows service. I googled it, using winrun4j we can achieve it. But the documentation is very less to understand to create.

Thanks in advance

Regards,
Sanath
 
Martin Vajsar
Sheriff
Pie
Posts: 3751
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a brief look at the winrun4j documentation and wouldn't say it is inadequately documented. You need to create a class implementing the Service interface, and create an ini file that will contain the name of this class in the service.class key (among other things). There is a small example of a simple service (ini file plus the source code).

What do you know about Windows Services themselves (ie. before getting Java into the picture)? I believe that if you read some info on Windows Services, the rest should be much more obvious to you.

You should also know that processes running as Windows services operate in a distinct environment, with some specific rules governing access rights (among others). If your application needs to access resources on the network (such as a shared folder), you may need to study a lot to get it working.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic