• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Adding Java App. to Windows Service

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
A feeble attempt to tell you about our stuff that makes us money
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic