Possible Duplicate:
Java: How could I “intercept” Ctrl+C in a CLI application?
On Windows I start a java non gui application doing a task Then press CNTL-C and the program just exits, none of my interrupt handling code seems to trigger, even putting a try/catch in the main method never displays a stack trace to indicate it has been interuppted.
public static void main(final String[] args) throws Exception
{
try
{
CmdLineDecoder cld = new CmdLineDecoder();
cld.start(args);
System.exit(0);
}
catch(Exception e)
{
e.printStackTrace();
throw e;
}
}
I'm clearly misunderstanding the effect of Cntl-C, but what ?