I\'m writing a C interface to a java library that calls System.exit(). I call:
/* Calls the main method for the class */
printf(\"about to call main\\n\");
(
You do not need bytecode editing for so simple case, a lot of security handling is implemented in the good old java.
System.setSecurityManager(SecurityManager) throw some Error (like ThreadDeath) in checkExit() and assuming System.exit(int) [erm Runtime.getRuntime().exit(int)] is invoked in the same thread, it should do it.