Go Back   AnandTech Forums > Software > Programming

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals
· Free Stuff
· Contests and Sweepstakes
· Black Friday 2012
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 08-30-2012, 02:25 AM   #1
toaries
Junior Member
 
Join Date: Aug 2012
Posts: 5
Default Java App like window Service

Hello

I want to run my java app like window service like it should not close when logoff on window and also it should be start automatically when window bootup. I used the JSmooth wrapper for that. Its now starting the java app on window boot. But problem is when I logoff on window it is closing my application. I really don’t want to close my Java Application on window logoff. plz suggest me the best possible solutions or some other wrapper which can perform that task.




Thanks
Regards
Mudasser
toaries is offline   Reply With Quote
Old 08-30-2012, 09:19 AM   #2
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,658
Default

If you wrote the app, why not just make it a real service?
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 08-30-2012, 09:29 AM   #3
IHateMyJob2004
Lifer
 
IHateMyJob2004's Avatar
 
Join Date: Sep 2004
Posts: 14,817
Default

Quote:
Originally Posted by Nothinman View Post
If you wrote the app, why not just make it a real service?
His application is written in java. Java applications can not run as a service natively.

He did what i have read that you must do to have it run as a service. You must use a wrapper or create your own wrapper in C.

OP,
Are there any options in your wrapper when launching the java app?
Does the wrapper you are using offer support?
__________________
Look at the Blackberry Z10 with an open mind. It is actually good!
FREE MUSIC - via torrent:
http://bt.etree.org/
or just download some free music:
http://www.archive.org/audio/etree-band-showall.php 100% LEGIT!
IHateMyJob2004 is offline   Reply With Quote
Old 08-30-2012, 02:25 PM   #4
Nothinman
Elite Member
 
Nothinman's Avatar
 
Join Date: Sep 2001
Posts: 30,658
Default

Quote:
Originally Posted by IHateMyJob2004 View Post
His application is written in java. Java applications can not run as a service natively.

He did what i have read that you must do to have it run as a service. You must use a wrapper or create your own wrapper in C.

OP,
Are there any options in your wrapper when launching the java app?
Does the wrapper you are using offer support?
Even if it can't be an official service in the control panel manner, isn't there a way to detach from the desktop session and move into the background?
__________________
http://www.debian.org
Nothinman is offline   Reply With Quote
Old 08-30-2012, 02:31 PM   #5
tfinch2
Lifer
 
tfinch2's Avatar
 
Join Date: Feb 2004
Posts: 21,575
Default

We use "Java Service Wrapper" from Tanuki. Works like a champ.

If you are looking for something open source, look at Apache Commons Daemon.
__________________
unban ^[a-zA-Z0-9]+$
tfinch2 is offline   Reply With Quote
Old 08-30-2012, 04:07 PM   #6
IHateMyJob2004
Lifer
 
IHateMyJob2004's Avatar
 
Join Date: Sep 2004
Posts: 14,817
Default

Quote:
Originally Posted by Nothinman View Post
Even if it can't be an official service in the control panel manner, isn't there a way to detach from the desktop session and move into the background?
Windows services require that a C API be implemented. It's something like 3 callback methods.

Without implementing those methods implemented, you can not use your application as a Windows service.
__________________
Look at the Blackberry Z10 with an open mind. It is actually good!
FREE MUSIC - via torrent:
http://bt.etree.org/
or just download some free music:
http://www.archive.org/audio/etree-band-showall.php 100% LEGIT!
IHateMyJob2004 is offline   Reply With Quote
Old 08-31-2012, 12:03 AM   #7
toaries
Junior Member
 
Join Date: Aug 2012
Posts: 5
Default

I just did Rnd and find JSmooth wrapper its work fine for me. like it added my app in Control panel service list and also starting my application on window boot but only problem left that when i log off then my application closed and i don't want to close on log off. i did some RnD and they are saying to change in the followings files
SunJVMExe.cpp or SunJVMDLL.cpp

http://sourceforge.net/projects/jsmo.../topic/2370742
http://sourceforge.net/projects/jsmo.../topic/5043499

But i m not able to find that files.
How i can find that file to change it.


Thanks
Regards
Mudasser
toaries is offline   Reply With Quote
Old 08-31-2012, 04:07 PM   #8
IHateMyJob2004
Lifer
 
IHateMyJob2004's Avatar
 
Join Date: Sep 2004
Posts: 14,817
Default

Wow, sounds like the fix is to modify the JVM. I've never gone down that path.

What you need to do (I think) is:
1) Get JVM source
2) Compile it (this could take some time to get everythign configured correctly)
3) make suggested changes
4) recompile
5) use new JVM

Thing is, if you are updating the source code for the JVM, I don't know why one wouldn't be able to simply make the JVM a service itself and remove the necessity for a wrapper.
__________________
Look at the Blackberry Z10 with an open mind. It is actually good!
FREE MUSIC - via torrent:
http://bt.etree.org/
or just download some free music:
http://www.archive.org/audio/etree-band-showall.php 100% LEGIT!
IHateMyJob2004 is offline   Reply With Quote
Reply

Tags
java

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:16 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.