tags:

views:

80

answers:

3

How can I disable force quit from within my java application? Either that, or how about disabling it from .plist?

+1  A: 

You can't. There is no way to handle SIGKILL, which will always terminate the application (Java or otherwise).

Matthew Flaschen
+4  A: 

You cannot disable force-quit in an application. Force-Quit is equivalent to sending the SIGKILL signal. By definition:

The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored.

Andres Jaan Tack
+1  A: 

I found a workaround. Using the .plist key "Application is agent (UIElement)" the application does not show up on the force quit list!

Jacob
Which list are you talking about? The one you get with Command-Option-Esc? Surely, that process shows up in the Activity Monitor, doesn't it? As others have said you can't stop SIGKILL (but you might indeed be able prevent someone from sending it...)
Bruno
Hey, now that's handy! Nice!
Andres Jaan Tack