Your question is very unclear, but if the call to System.exit succeeds, the OS will terminate your application.
If you want System.exit to fail, you can install the security manager and prevent this. In addition, you can process the code through a custom class loader and remove the call.
Edit: if you run w / Security manager, most likely throwing a SecurityException, this will stop the thread. If this is not the case, cheat and quit ThreadDeath. If this is not the case, just hold the thread, for example. for(;;) Thread.sleep(10000); The latter flows through the thread and its resources, but at least it wonβt kill your application.
link to a similar question
source share