aspose file tools*
The moose likes Java in General and the fly likes Adding Java App. to Windows Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Adding Java App. to Windows Service" Watch "Adding Java App. to Windows Service" New topic
Author

Adding Java App. to Windows Service

sanjeet khanuja
Greenhorn

Joined: Jan 01, 2003
Posts: 2
i want to know whether we can add java app (where app is a java class file) directly to windows service. I DONT WANT To CONVERT JAVA APPLICATION TO EXE FILE. i simply want to add java.exe and java program file as target for windows service.
WINDOWS SERVICE CAN USE JAVA.EXE AS EXECUABLE FILE AND CLASSPATH AND PROGRAM TO BE EXECUTED CAN BE AUGUMENTS THAT ARE CONFIGURED IN SERVICE.
START/STOP should work through WINDOWS SERVICES. I DONT WANT BATCH/EXE FILE TO CONTROL START/STOP OPERATIONS.
sanjeet.khanuja@mentorix.com
Rit Faisal
Greenhorn

Joined: May 16, 2001
Posts: 7
It is really challanging Because, windows API requires C function which will be started as a separate thread. In addition, it requires function to "install", "uninstall", "start" and "stop". All these have to be C functions. You have to write the service in C/C++ (see msdn.microsoft.com to find out how).
Inside your service however, you can start your JAVA process or kill your JAVA process (in from start and stop functions respectively)
Originally posted by sanjeet khanuja:
i want to know whether we can add java app (where app is a java class file) directly to windows service. I DONT WANT To CONVERT JAVA APPLICATION TO EXE FILE. i simply want to add java.exe and java program file as target for windows service.
WINDOWS SERVICE CAN USE JAVA.EXE AS EXECUABLE FILE AND CLASSPATH AND PROGRAM TO BE EXECUTED CAN BE AUGUMENTS THAT ARE CONFIGURED IN SERVICE.
START/STOP should work through WINDOWS SERVICES. I DONT WANT BATCH/EXE FILE TO CONTROL START/STOP OPERATIONS.
sanjeet.khanuja@mentorix.com

Roy Tock
Ranch Hand

Joined: Jul 16, 2001
Posts: 83
Check out http://wrapper.tanukisoftware.org. It's an open source product, hosted by SourceForge, that wraps a Java program with a Windows service.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding Java App. to Windows Service