Fixing Eclipse for Ubuntu Karmic Koala 9.10
Today I upgraded my Ubuntu installation to the newly released Karmic Kaola. Except for a couple of glitches during the upgrade process (maybe later more about this), I was able to login to my updated system about an hour later. I opened up Eclipse (running 3.5 – Galileo) to continue my Java development tasks. But very soon I noticed the upgrade introduced severe issues with my favorite IDE, most notably, the buttons on most dialog boxes could not be pushed anymore. Here’s how I managed to fix it ….
The new Ubuntu release 9.10 brings version 2.18 of GTK+ to the desktop. GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, the GTK+ is suitable for projects ranging from small one-off tools to complete application suites. In version 2.18, client side windows are introduced which brings nicer redrawing and resizing, as demonstrated in the video :
Some applications – Eclipse, but also Acroread – assume that they can just operate on the X windows corresponding to their GDK windows without ever telling GDK, which causes some widgets to exhibit weird behaviour. Bug 287307 was filed with the Eclipse foundation and this is fixed for the upcoming 3.6 release.
Fortunately, the GTK+ people provide a switch to turn off the client side windows. So to work around the bug with Eclipse pre-3.6, just make sure you set environment variable GDK_NATIVE_WINDOWS=1
#!/bin/sh
export GDK_NATIVE_WINDOWS=1
/home/koen/eclipse-galileo/eclipse
Start coding
October 30th, 2009 at 17:56
You are my hero. Works PERFECT!
November 2nd, 2009 at 22:11
thnx! THNX! and another THNX….
November 3rd, 2009 at 01:12
Precisely the info I was looking for… thanks very much for posting
November 3rd, 2009 at 17:25
Thx for the awesome tip!! This was invaluable to me
November 4th, 2009 at 15:28
Thankyou thankyou thankyou thankyou thankyou.
Had the same issues with the unpushable buttons, I eventually worked out to press enter to hit the ok/submit buttons.
November 4th, 2009 at 15:57
[...] Thaks for that! Fixing Eclipse for Ubuntu Karmic Koala 9.10: http://blog.export.be/2009/10/fixing-eclipse-for-ubuntu-karmic-koala-9-10/ [...]
November 4th, 2009 at 16:10
Many thanks, I noticed this problem last night. The weird thing is that as soon as a button has focus, you can “press” it using or .
November 4th, 2009 at 19:24
Interesting. GVim spits out a bunch of errors since the Karmic upgrade and this environment variable fixes it too.
November 4th, 2009 at 21:29
The /usr/bin/eclipse script in Karmic has “export GDK_NATIVE_WINDOWS=true”, which presumably has the same effect as your suggestion. Handy tip though, I was getting this behavior in Apache Directory Studio, so I copied the /usr/bin/eclipse wrapper script and use it to set the environment variable.
November 4th, 2009 at 23:04
I had the same issue, solved by using the karmic-repository version of eclipse. No magic in this version, just the startup script, as Paul Dorman mentions above. The complete values of the file are:
#!/bin/sh
# work around e#290395 / LP: #458703
export GDK_NATIVE_WINDOWS=true
xuldir=/usr/lib/xulrunner-$(/usr/bin/xulrunner-1.9.1 –gre-version)
LD_LIBRARY_PATH=$xuldir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} /opt/eclipse/eclipse “$@”
FWIW, this was broken on my (clean) 64bit install, but until I found this fix the eclipse x86 version worked correctly as well.
November 4th, 2009 at 23:33
Hi Paul,
I didn’t use the version from the repository but just extracted Eclipse to my home dir.
Thx,
Koen
November 5th, 2009 at 23:58
Perfect. Thanks.
-Dan
November 6th, 2009 at 00:23
Thanks a ton. This has been driving me nuts.
November 7th, 2009 at 00:30
Thanks a lot, really getting me crazy
Not sure if it worked for me, still having trouble with mouse click, but at least it is working for keyboard (ALT+ and Enter).
November 7th, 2009 at 00:33
Sorry, it was my errors GDK_NATIVE_WINDOW instead of GDK_NATIVE_WINDOWS
thanks a million again
November 7th, 2009 at 18:30
wow, thanks so much as everyone else had said, it was driving me up the wall and I avoided programming because of it.
November 8th, 2009 at 21:31
Hi, when I open a runtime instance of Eclipse, the problem happens again. Any idea how to cope with it? (this time I don’t know where to provide the GDK_NATIVE_WINDOW value). Thanks.
November 8th, 2009 at 23:04
Thanks for this. I have a desktop shortcut to launch my eclipse. I have now modified it to this:
bash -c “GDK_NATIVE_WINDOWS=1 /home/steveb/dev/apps/eclipse/ide/eclipse-3.5.0/eclipse”
No shell wrapper script required.
November 9th, 2009 at 13:48
this trick does not work for me, I’m using eclipse 3.3.2 under ubuntu karmic
November 11th, 2009 at 21:05
Awesome – I was fighting with this for a day or so. Thanks so much for the fix!
November 13th, 2009 at 19:09
THANKS!!!!!!!!
November 16th, 2009 at 07:17
Thank you! Perfectly fixed my problem
November 16th, 2009 at 12:54
barakallahou fik (I think in english: god bless you)
November 18th, 2009 at 17:26
Thanks man. that worked.
November 18th, 2009 at 17:37
Thanks a bunch, you’ve saved the day for me!
November 18th, 2009 at 17:39
[...] found out by googling a bit more till I eventually found this page: http://blog.export.be/2009/10/fixing-eclipse-for-ubuntu-karmic-koala-9-10. After following the instructions on said page it suddenly worked fine. It’s very likely that [...]
November 20th, 2009 at 16:40
[...] can read more about the GTK story here: http://blog.export.be/2009/10/fixing-eclipse-for-ubuntu-karmic-koala-9-10/. Kudos to the author, without that article it would have taken me a very long time to figure this [...]
December 19th, 2009 at 00:21
Thanks! It worked – and I was panicking about losing all my eclipse based work.
December 21st, 2009 at 04:08
[...] I made a similar change to the launcher for eclipse. See http://www.eclipse.org/forums/index.php?&t=msg&th=153842 and http://blog.export.be/2009/10/fixing-eclipse-for-ubuntu-karmic-koala-9-10/. [...]
December 22nd, 2009 at 15:55
Thank you very much for posting this tip! This bug is really nasty.
December 22nd, 2009 at 18:38
Thank you very much. It worked. You have saved quite some time.
December 28th, 2009 at 12:42
Oren,
you have to add the GDK_NATIVE_WINDOWS variable to Run -> Run Configurations -> Environment. Then fill “name” GDK_NATIVE_WINDOWS and “value” 1.
It works for me.
Bye!
December 30th, 2009 at 10:46
[...] Btw, for those of you who can’t get eclipse buttons to respond correctly, maybe this link has your answer: http://blog.export.be/2009/10/fixing-eclipse-for-ubuntu-karmic-koala-9-10/ [...]
January 3rd, 2010 at 15:53
thanks a lot! This perfectly worked
January 4th, 2010 at 07:14
I added “GDK_NATIVE_WINDOWS variable to Run -> Run Configurations -> Environment. Then fill “name” GDK_NATIVE_WINDOWS and “value” 1. ”
it didn’t work for me, i’m using eclipse 3.5.
January 5th, 2010 at 21:13
[...] first line is needed to fix a bug. Read more here if you want to know [...]
January 12th, 2010 at 19:02
wow !!! thanks for the wonderful tip…i had almost given up trying to fix this
January 19th, 2010 at 17:49
Nice Find! Thanks a lot.
January 21st, 2010 at 13:31
My Hero. GREAT!
February 2nd, 2010 at 07:02
Wow, thanks, this really helps