This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Java App. to Windows Service

 
sanjeet khanuja
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out http://wrapper.tanukisoftware.org. It's an open source product, hosted by SourceForge, that wraps a Java program with a Windows service.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic