This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CTRL+C is not working with java on latest cygwin 1.7.15


There is nothing special about the Java program. Might be e.g. 
public class ShutdownHookTester
{
  public static void main(String[] args) {
    Runtime.getRuntime().addShutdownHook(new Thread()
    {
      public void run() {
        System.out.println("Cleaning up");
      }
    });
    for (int i=0;i<10000;i++)
    {
      System.out.print(".");
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
      }
    }
  }
}

When run under CygWin, pressing CTRL-C will just give you your shell prompt:
$java -cp target/other-utils-1.0.jar com.edb.bds.util.ShutdownHookTester
...
$
Run from cmd.exe, however, the Shutdown Hook is executed as it should be,
yielding:
C:\java -cp . com.edb.bds.util.ShutdownHookTester
....Cleaning up
C:\




--
View this message in context: http://cygwin.1069669.n5.nabble.com/CTRL-C-is-not-working-with-java-on-latest-cygwin-1-7-15-tp63179p94878.html
Sent from the Cygwin list mailing list archive at Nabble.com.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]