title: Why isn't javaw.exe exiting on Windows 8?
body: <p>I'm using Java <code>1.6.0_41</code> and I have a listener attached to when frames are about to close. <code>System.exit(0)</code> is successfully being called and the window for the application closes. However, in the Task Manager, javaw.exe is still running. 
  Which thread is causing the block?</p>
  
  <p><strong>Update</strong>
  It looks like the <code>awt.windows</code> is still running and thus the shutdown hooks aren't finishing. Calling dispose() on Windows 8 prior to calling System.exit allows my app to close and the jvm to exit. </p>
  
  <p><img src="https://i.stack.imgur.com/WgSEE.png" alt="enter image description here"></p>
  
  <pre><code> 2014-10-15 12:31:58
  Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.14-b01 mixed mode):
  
  "RMI TCP Connection(2)-192.168.10.70" daemon prio=6 tid=0x00000000075a3000 nid=0x163c runnable [0x000000000a7df000]
     java.lang.Thread.State: RUNNABLE
  at java.net.SocketInputStream.socketRead0(Native Method)
  at java.net.SocketInputStream.read(SocketInputStream.java:129)
  at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
  - locked &lt;0x00000007ac9dc9c0&gt; (a java.io.BufferedInputStream)
  at java.io.FilterInputStream.read(FilterInputStream.java:66)
  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:517)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - &lt;0x00000007ac778c70&gt; (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
  
  "JMX server connection timeout 84" daemon prio=6 tid=0x00000000075a4800 nid=0xd74 in Object.wait() [0x000000000a6df000]
     java.lang.Thread.State: TIMED_WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x00000007ac848288&gt; (a [I)
  at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(ServerCommunicatorAdmin.java:150)
  - locked &lt;0x00000007ac848288&gt; (a [I)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "RMI Scheduler(0)" daemon prio=6 tid=0x00000000075a6000 nid=0xf9c waiting on condition [0x000000000a5df000]
     java.lang.Thread.State: TIMED_WAITING (parking)
  at sun.misc.Unsafe.park(Native Method)
  - parking to wait for  &lt;0x00000007ac4abc20&gt; (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
  at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
  at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602)
  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:957)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:917)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "RMI TCP Connection(1)-192.168.10.70" daemon prio=6 tid=0x00000000075a2000 nid=0xedc runnable [0x000000000a30f000]
     java.lang.Thread.State: RUNNABLE
  at java.net.SocketInputStream.socketRead0(Native Method)
  at java.net.SocketInputStream.read(SocketInputStream.java:129)
  at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
  - locked &lt;0x00000007ac7d3670&gt; (a java.io.BufferedInputStream)
  at java.io.FilterInputStream.read(FilterInputStream.java:66)
  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:517)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - &lt;0x00000007ac7767c0&gt; (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
  
  "RMI TCP Accept-0" daemon prio=6 tid=0x00000000075a1800 nid=0x378 runnable [0x000000000994f000]
     java.lang.Thread.State: RUNNABLE
  at java.net.PlainSocketImpl.socketAccept(Native Method)
  at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
  - locked &lt;0x00000007ac4b5c38&gt; (a java.net.SocksSocketImpl)
  at java.net.ServerSocket.implAccept(ServerSocket.java:462)
  at java.net.ServerSocket.accept(ServerSocket.java:430)
  at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:34)
  at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
  at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "Thread-4" daemon prio=6 tid=0x00000000075a3800 nid=0x518 runnable [0x000000000bddf000]
     java.lang.Thread.State: RUNNABLE
  at sun.awt.windows.WToolkit.shutdown(Native Method)
  at sun.awt.windows.WToolkit.access$200(WToolkit.java:70)
  at sun.awt.windows.WToolkit$2$1.run(WToolkit.java:278)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "Timer-1" daemon prio=6 tid=0x000000000e21e000 nid=0xbc in Object.wait() [0x000000001095f000]
     java.lang.Thread.State: TIMED_WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x00000007049a7bb0&gt; (a java.util.TaskQueue)
  at java.util.TimerThread.mainLoop(Timer.java:509)
  - locked &lt;0x00000007049a7bb0&gt; (a java.util.TaskQueue)
  at java.util.TimerThread.run(Timer.java:462)
  
     Locked ownable synchronizers:
  - None
  
  "Timer-0" daemon prio=6 tid=0x000000000e219800 nid=0x1454 in Object.wait() [0x000000001085f000]
     java.lang.Thread.State: TIMED_WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x0000000704ac9d30&gt; (a java.util.TaskQueue)
  at java.util.TimerThread.mainLoop(Timer.java:509)
  - locked &lt;0x0000000704ac9d30&gt; (a java.util.TaskQueue)
  at java.util.TimerThread.run(Timer.java:462)
  
     Locked ownable synchronizers:
  - None
  
  "DestroyJavaVM" prio=6 tid=0x000000000e21b800 nid=0xba8 waiting on condition [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "TimerQueue" daemon prio=6 tid=0x000000000e21c800 nid=0x1548 in Object.wait() [0x000000000facf000]
     java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x0000000704827188&gt; (a javax.swing.TimerQueue)
  at javax.swing.TimerQueue.run(TimerQueue.java:232)
  - locked &lt;0x0000000704827188&gt; (a javax.swing.TimerQueue)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "AWT-EventQueue-0" prio=6 tid=0x00000000089b8800 nid=0xd60 in Object.wait() [0x000000000bfdd000]
     java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x00000007045d60e0&gt; (a java.lang.Thread)
  at java.lang.Thread.join(Thread.java:1186)
  - locked &lt;0x00000007045d60e0&gt; (a java.lang.Thread)
  at java.lang.Thread.join(Thread.java:1239)
  at java.lang.ApplicationShutdownHooks.runHooks(ApplicationShutdownHooks.java:79)
  at java.lang.ApplicationShutdownHooks$1.run(ApplicationShutdownHooks.java:24)
  at java.lang.Shutdown.runHooks(Shutdown.java:79)
  at java.lang.Shutdown.sequence(Shutdown.java:123)
  at java.lang.Shutdown.exit(Shutdown.java:168)
  - locked &lt;0x00000006fe24ca68&gt; (a java.lang.Class for java.lang.Shutdown)
  at java.lang.Runtime.exit(Runtime.java:90)
  at java.lang.System.exit(System.java:904)
  at com.hiddensoftware.hiddengui.HiddenFrame.attemptToExit(HiddenFrame.java:636)
  at com.hiddensoftware.hiddengui.HiddenFrame.exit(HiddenFrame.java:620)
  at com.hiddensoftware.hiddengui.HiddenFrame$14.windowClosing(HiddenFrame.java:2554)
  at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
  at java.awt.Window.processWindowEvent(Window.java:1871)
  at javax.swing.JFrame.processWindowEvent(JFrame.java:274)
  at java.awt.Window.processEvent(Window.java:1829)
  at java.awt.Component.dispatchEventImpl(Component.java:4660)
  at java.awt.Container.dispatchEventImpl(Container.java:2097)
  at java.awt.Window.dispatchEventImpl(Window.java:2489)
  at java.awt.Component.dispatchEvent(Component.java:4488)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:674)
  at java.awt.EventQueue.access$400(EventQueue.java:81)
  at java.awt.EventQueue$2.run(EventQueue.java:633)
  at java.awt.EventQueue$2.run(EventQueue.java:631)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
  at java.awt.EventQueue$3.run(EventQueue.java:647)
  at java.awt.EventQueue$3.run(EventQueue.java:645)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:644)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
  
     Locked ownable synchronizers:
  - None
  
  "AWT-Windows" daemon prio=6 tid=0x000000000857d800 nid=0xe74 runnable [0x0000000009d0f000]
     java.lang.Thread.State: RUNNABLE
  at sun.awt.windows.WToolkit.eventLoop(Native Method)
  at sun.awt.windows.WToolkit.run(WToolkit.java:293)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "AWT-Shutdown" prio=6 tid=0x000000000857c800 nid=0x28c in Object.wait() [0x0000000009c0f000]
     java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x0000000704ae1ba8&gt; (a java.lang.Object)
  at java.lang.Object.wait(Object.java:485)
  at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:265)
  - locked &lt;0x0000000704ae1ba8&gt; (a java.lang.Object)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "Java2D Disposer" daemon prio=10 tid=0x00000000075b5000 nid=0x13d0 in Object.wait() [0x0000000009a4f000]
     java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x0000000704906618&gt; (a java.lang.ref.ReferenceQueue$Lock)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
  - locked &lt;0x0000000704906618&gt; (a java.lang.ref.ReferenceQueue$Lock)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
  at sun.java2d.Disposer.run(Disposer.java:127)
  at java.lang.Thread.run(Thread.java:662)
  
     Locked ownable synchronizers:
  - None
  
  "Low Memory Detector" daemon prio=6 tid=0x0000000007561800 nid=0xef4 runnable [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "C2 CompilerThread1" daemon prio=10 tid=0x00000000074f2800 nid=0x1474 waiting on condition [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "C2 CompilerThread0" daemon prio=10 tid=0x00000000074f1000 nid=0x105c waiting on condition [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "JDWP Command Reader" daemon prio=6 tid=0x00000000021dd000 nid=0xc8c runnable [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "JDWP Event Helper Thread" daemon prio=6 tid=0x00000000021d5800 nid=0xe38 runnable [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "JDWP Transport Listener: dt_socket" daemon prio=6 tid=0x00000000021d1800 nid=0x15d0 runnable [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "Attach Listener" daemon prio=10 tid=0x00000000021bf000 nid=0x16fc waiting on condition [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "Signal Dispatcher" daemon prio=10 tid=0x00000000021be000 nid=0x1010 runnable [0x0000000000000000]
     java.lang.Thread.State: RUNNABLE
  
     Locked ownable synchronizers:
  - None
  
  "Finalizer" daemon prio=8 tid=0x00000000021a4000 nid=0x1070 in Object.wait() [0x0000000006c5f000]
     java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x00000007044c0f68&gt; (a java.lang.ref.ReferenceQueue$Lock)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
  - locked &lt;0x00000007044c0f68&gt; (a java.lang.ref.ReferenceQueue$Lock)
  at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
  at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
  
     Locked ownable synchronizers:
  - None
  
  "Reference Handler" daemon prio=10 tid=0x00000000021a0800 nid=0x12e4 in Object.wait() [0x0000000006b5f000]
     java.lang.Thread.State: WAITING (on object monitor)
  at java.lang.Object.wait(Native Method)
  - waiting on &lt;0x00000007044c0f00&gt; (a java.lang.ref.Reference$Lock)
  at java.lang.Object.wait(Object.java:485)
  at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
  - locked &lt;0x00000007044c0f00&gt; (a java.lang.ref.Reference$Lock)
  
     Locked ownable synchronizers:
  - None
  
  "VM Thread" prio=10 tid=0x000000000219a800 nid=0x17ec runnable 
  
  "GC task thread#0 (ParallelGC)" prio=6 tid=0x00000000020f6800 nid=0xfbc runnable 
  
  "GC task thread#1 (ParallelGC)" prio=6 tid=0x00000000020f8800 nid=0xa18 runnable 
  
  "GC task thread#2 (ParallelGC)" prio=6 tid=0x00000000020fa000 nid=0x1634 runnable 
  
  "GC task thread#3 (ParallelGC)" prio=6 tid=0x00000000020fb800 nid=0x16c4 runnable 
  
  "VM Periodic Task Thread" prio=10 tid=0x0000000007507000 nid=0x16b0 waiting on condition 
  
  JNI global references: 16785
  </code></pre>