Step by Step

Hitesh  Kr. Seth

Problem: How to make a Java NT Service

1. Implement your Java Server (for this project it's class is Server)

  these classes are (say) installed in C:\users\hks 

2. Implement the C program which implements the Service, it uses Invocation API of JDK 1.1Final 

this file is kept in (say) C:\users\hks\service.exe 

3. Implement the C program which installs the NT Service 

4. Install the Service in Windows NT 

5. Go to Control Panel and start the Service 

6. Try Contacting the Service (connect to port 4000) and it should give you the date,time of the day.

Source Code 


This article is provided as is without any express or implied warranties.  While every effort has been taken to ensure the accuracy of the information contained in this article, the author assume no responsibility for errors or omissions, or  for damages resulting from the use of the information  contained herein.
Note: Parts of this article are taken from MSVC 2.0 Sample Source Code distribution. service.c is a tailored version of an MSVC example
Copyright (c) 1997 by Hitesh Kr. Seth, all rights reserved
This document may be posted to any USENET newsgroup, on-line service, or BBS as long as it is posted in its entirety and includes this copyright statement.
This document may not be distributed for financial gain.
This document may not be included in commercial collections or compilations without express permission from the author

Hitesh Kr. Seth hks@wipsys.soft.net