As stated in the Java 6 System.exit()
docs:
The call System.exit(n)
is effectively equivalent to the call: Runtime.getRuntime().exit(n)
And, if you go and look at Runtime.exit()
(my bold):
Terminates the currently running Java virtual machine by initiating its shutdown sequence. This method never returns normally.
The virtual machine's shutdown sequence consists of two phases. In the first phase all registered shutdown hooks, if any, are started in some unspecified order and allowed to run concurrently until they finish. In the second phase all uninvoked finalizers are run if finalization-on-exit has been enabled. Once this is done the virtual machine halts.
Basically, the only one this function can return (and hence allow the finally
clause to run) is for it to raise a SecurityException
because whatever security manager is running disallows exiting with the given code.