venishjoe
asked on
Writing Java Program to run as a Windows (NT) Service
Hi Experts,
I have a Java application which should run as a Windows (NT) Service. There are many tools
like Wrapper to do this. But how can I do this in my java code itself. It should be only using java, I cannot use languages like C along with Java. So is there any methods to do this?
Can you provide me with links or sample code or any valuebale tips?
Thanking You.
I have a Java application which should run as a Windows (NT) Service. There are many tools
like Wrapper to do this. But how can I do this in my java code itself. It should be only using java, I cannot use languages like C along with Java. So is there any methods to do this?
Can you provide me with links or sample code or any valuebale tips?
Thanking You.
You can't do it without using some native code. You could use a batch file though and use the Windows scheduler to start it at startup
@echo off
java -classpath x\y\z YourProgram
Save the above as a batch file and have Windows scheduler execute it at startup
java -classpath x\y\z YourProgram
Save the above as a batch file and have Windows scheduler execute it at startup
(or javaw)
ASKER
I dont want scheduler to start it up. Basically my code is a proxy server and I need it as running as a service
ASKER
So how to do with native code?
Hi, check these links out.
http://bdn.borland.com/article/0,1410,32068,00.html
http://wrapper.tanukisoftware.org/doc/english/index.html
/Nick
http://bdn.borland.com/article/0,1410,32068,00.html
http://wrapper.tanukisoftware.org/doc/english/index.html
/Nick
You shouldn't try to write native code. Use the classes you've already referred to that already exist
Run a Java app as Windows service:
http://www.kcmultimedia.com/javaserv/
http://www.devx.com/Java/Article/21604
http://www.kcmultimedia.com/javaserv/
http://www.devx.com/Java/Article/21604
ASKER
Hi Nick_72,
The two links you mentioned is reffering to the Wrapper, which is a tool. But I dont want to use an external tool.
Hi zzynx,
Your Links also refer to tools.
Hi objects
Your link is also referring to Wrapper
Hi CEHJ,
Can you explain your statement more precisely?
The two links you mentioned is reffering to the Wrapper, which is a tool. But I dont want to use an external tool.
Hi zzynx,
Your Links also refer to tools.
Hi objects
Your link is also referring to Wrapper
Hi CEHJ,
Can you explain your statement more precisely?
>>Can you explain your statement more precisely?
What i mean is that if you don't want to implement my suggestion for avoiding 3rd party libraries (not quite clear why you don't) then you shouldn't reinvent the wheel by writing native code when that's what the 3rd party classes do. Simply use them
What i mean is that if you don't want to implement my suggestion for avoiding 3rd party libraries (not quite clear why you don't) then you shouldn't reinvent the wheel by writing native code when that's what the 3rd party classes do. Simply use them
> Your link is also referring to Wrapper
It includes source code, use that as a guide to write your own :)
It includes source code, use that as a guide to write your own :)
ASKER
Hi CEHJ,
Well can you suggest some pre existing classes for this purpose?
Well can you suggest some pre existing classes for this purpose?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
venishjoe, shouldn't the poster of the link (Nick_72) get some points too?
Probably i think ;-)
ASKER
Oh! Should be, Sorry guys!!
Well, you can ask to reopen this question:
1) Post a zero-point question in https://www.experts-exchange.com/Community_Support/
Subject: Moderator Please Reopen
Body: Please reopen this question:
https://www.experts-exchange.com/questions/21421662/Writing-Java-Program-to-run-as-a-Windows-NT-Service.html
2) Once reopened you can re-accept using a split
1) Post a zero-point question in https://www.experts-exchange.com/Community_Support/
Subject: Moderator Please Reopen
Body: Please reopen this question:
https://www.experts-exchange.com/questions/21421662/Writing-Java-Program-to-run-as-a-Windows-NT-Service.html
2) Once reopened you can re-accept using a split
Thank you very much guys for the concern, but it's alright with me :)
If you haven't posted already you can just leave it be.
Regards,
Nick
If you haven't posted already you can just leave it be.
Regards,
Nick