Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7082825

javaw programs showing windows do not close on Microsoft Windows shutdown/logoff

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 6u26
    • tools
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.6.0_25"
      Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
      Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)

      java version "1.6.0_27"
      Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
      Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)

      java version "1.7.0"
      Java(TM) SE Runtime Environment (build 1.7.0-b147)
      Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]
      Microsoft Windows [Version 6.1.7600]


      A DESCRIPTION OF THE PROBLEM :
      javaw programs showing windows do not close on Microsoft Windows shutdown/logoff.

      A java application that uses windows/frames does not close when MSWindows shuts down (or logs off). This occurs since 1.6.0_25 (_26, _27 and 1.7 also). On versions 1.6.0_24 and earlier it works as expected.

      Closing the java application or killing it via PSKill or the Windows task manager does close the java application successfully. Windows Shutdown however does not close the java application. Windows finds that the java application is not responding. This occurs on both Windows 7 and Windows XP. Windows (XP) offers the option to 'End now' or 'Cancel', but both options cause the java application to close.

      If the java application is started with java.exe it can be shutdownd successfully, if however javaw is used to launch the application it becomes not responding on Windows shutdown.

      A tiny program to reproduce te problem:
        -------------- TestShutdown.java -------------------------------
        import javax.swing.JFrame;

        public class TestShutdown {
          public static void main(String[] args) {
            JFrame frame = new JFrame("TestIt");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
          }
        }
        ----------------------------------------------------------------

        Command line Windows Shutdown
        ---------------------------------------------------------
        java -version:1.6.0_24 TestShutdown Closes immediately
        java -version:1.6.0_25 TestShutdown Closes immediately
        java -version:1.7 TestShutdown Closes immediately
        javaw -version:1.6.0_24 TestShutdown Closes immediately
        javaw -version:1.6.0_25 TestShutdown Not responding
        javaw -version:1.6.0_26 TestShutdown Not responding
        javaw -version:1.6.0_27 TestShutdown Not responding
        javaw -version:1.7 TestShutdown Not responding

      Using the windows Shutdown command from the Windows CMD.exe results in the
      following:
                                                 Shutdown Java application
        Command line options
        -------------------------------------------------------------------------------
        javaw -version:1.6.0_24 TestShutdown -l Closes immediately
        javaw -version:1.6.0_24 TestShutdown -l -f Closes immediately
        javaw -version:1.6.0_25 TestShutdown -l Closes after a few seconds
        javaw -version:1.6.0_25 TestShutdown -l -f Not responding
        java -version:1.6.0_25 TestShutdown -l Closes immediately
        java -version:1.6.0_25 TestShutdown -l -f Closes immediately



      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JFrame;

      public class TestShutdown {
        public static void main(String[] args) {
          JFrame frame = new JFrame("TestIt");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
        }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Close java application before shutting down windows

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: