Preventing JVM from executing System.exit()
how to prevent from executing System.e开发者_开发技巧xit(). If in middle of code exit() method is called. JVM should throw compile time exception
does this thread help?
Otherwise/In short, you could implement your own Security Manager like this:
class MySecurityManager extends SecurityManager {
@Override public void checkExit(int status) {
throw new SecurityException();
}
}
精彩评论