View Full Version : Java 1.6 swing events freeze during debug
Tanked
February 11th, 2009, 10:03 AM
I was just wondering if anyone is having issues debugging java swing applications. With java 1.5 I had no problems, now that we are in 1.6_11, when I debug a swing application the X display completely freezes and I have to kill the debugging app (intellij or eclipse). I did hear something about 1.6_12 that fixed a combo box issue but 1.6_12 has issues as well. Has anyone else had issues with the X display freezing?
NOTE: these are the sun jvms.
cl333r
February 11th, 2009, 10:36 AM
The X display? Or you just mean the window?
Are you sure you tested your code enough with and without separate threads like the following?
final JFrame win = ...;
SwingUtilities.invokeLater( new Runnable() {
public void run() {
win.setVisible(true);
}
});
Tanked
February 11th, 2009, 01:54 PM
No, it does not have anything to do with a java window, its not an internal design/coding flaw. Its freezing the X display completely, can't click on another window (i.e. terminal, mail application, etc.). I take the jar I am using, launch it with java 1.5 and debug it, fine. I take the jar I am using, launch it with java 1.6 and debug it, to get access to any application on my desktop I have to kill the process I am debugging then my desktop can be used.
cl333r
February 11th, 2009, 03:21 PM
Since you're sure it must be Java's fault I can only suggest you report this issue as a bug to Sun Microsystems.
Since Sun cares a lot more about its own IDE (NetBeans) try also testing your code on NetBeans 6.5
Tanked
February 11th, 2009, 08:52 PM
I would agree, but it doesn't happen on other platforms, just ubuntu. Thought I would check here first in case anyone else has had this issue.
tfasanga
February 20th, 2009, 10:52 AM
I have the same issue with java 6 (from update 7 to 12) and Ubuntu (Gnome, 64-bit, 8.04).
mebigfatguy
December 22nd, 2009, 05:30 PM
this just happened to me with 1.6.0_17 on Karmic setting break points in an JComboBox ItemListener. Everything locked up
maybe related to this: http://bugs.sun.com/view_bug.do?bug_id=6384219
also see
http://wiki.netbeans.org/wiki/view/FaqDebuggingAWTXWindows
i am using eclipse 3.5
cawo
April 29th, 2010, 03:36 AM
Found a workaround: Add the following to your VM parameters:
-Dsun.awt.disablegrab=true
found here: http://bugs.sun.com/view_bug.do?bug_id=6714678
Works for me.
alanmehio
January 16th, 2011, 05:54 AM
Found a workaround: Add the following to your VM parameters:
-Dsun.awt.disablegrab=true
found here: http://bugs.sun.com/view_bug.do?bug_id=6714678
Works for me.
Actually I tried debug the a simple Swing application with event handling for JComboBox with the above jvm paramteter. Still the same problem
The desktop freezes just dead. the the following java version
OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu1~10.04.1)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)
Hope there is a solution for this problem
clpineda
March 23rd, 2011, 03:24 PM
The same behavior with:
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
Ubuntu 10.10
yurx cherio
March 31st, 2011, 03:21 PM
I am getting the same problem. It freezes as soon as it stops at a breakpoint.
Java 1.6.0.24
Eclipse 3.6
Ubuntu 10.10 amd64
Update: using "-Dsun.awt.disablegrab=true" did the trick. I added this argument to my project launch configuration and the debugging is back. Feels like voodoo.
valenajarro
June 10th, 2011, 12:20 PM
Thanks pals! The workaround solved the problem for me on 32-bit Ubuntu 11.04 & NetBeans 6.9
alanmehio
August 5th, 2011, 05:29 PM
adding -Dsun.awt.disablegrab=true to the JVM argument; it works very nice and fine now.
:KS
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.