Fixing Eclipse for Ubuntu Karmic Koala 9.10

eclipse48Today 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 :-)

Tags: , , , , ,

40 Responses to “Fixing Eclipse for Ubuntu Karmic Koala 9.10”

  1. Federico Says:

    You are my hero. Works PERFECT! :-)

  2. gassie Says:

    thnx! THNX! and another THNX….

  3. Ross Heflin Says:

    Precisely the info I was looking for… thanks very much for posting

  4. vishwak Says:

    Thx for the awesome tip!! This was invaluable to me

  5. G Says:

    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.

  6. Iwan van der Kleijn (soyrochus) 's status on Wednesday, 04-Nov-09 14:57:42 UTC - Identi.ca Says:

    [...] 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/ [...]

  7. Stathis Says:

    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 .

  8. Kris Says:

    Interesting. GVim spits out a bunch of errors since the Karmic upgrade and this environment variable fixes it too.

  9. Paul Dorman Says:

    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.

  10. Steve Benjamin Says:

    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.

  11. koma Says:

    Hi Paul,

    I didn’t use the version from the repository but just extracted Eclipse to my home dir.

    Thx,

    Koen

  12. Dan Says:

    Perfect. Thanks.

    -Dan

  13. Douglas Says:

    Thanks a ton. This has been driving me nuts.

  14. Tonio Says:

    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).

  15. Tonio Says:

    Sorry, it was my errors GDK_NATIVE_WINDOW instead of GDK_NATIVE_WINDOWS
    thanks a million again :)

  16. Ann Says:

    wow, thanks so much as everyone else had said, it was driving me up the wall and I avoided programming because of it.

  17. Oren Says:

    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.

  18. Steve Baker Says:

    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.

  19. kolodrevskiy Says:

    this trick does not work for me, I’m using eclipse 3.3.2 under ubuntu karmic

  20. Amy Says:

    Awesome – I was fighting with this for a day or so. Thanks so much for the fix!

  21. pascal Says:

    THANKS!!!!!!!! ;)

  22. Marshall Says:

    Thank you! Perfectly fixed my problem

  23. Sofiene Says:

    barakallahou fik (I think in english: god bless you) :)

  24. mohan Says:

    Thanks man. that worked.

  25. Mark Says:

    Thanks a bunch, you’ve saved the day for me!

  26. Finally, Eclipse works! « without-brains.net Says:

    [...] 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 [...]

  27. Manual Eclipse install in Fedora 12 and Ubuntu 9.10 « without-brains.net Says:

    [...] 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 [...]

  28. Mike F Says:

    Thanks! It worked – and I was panicking about losing all my eclipse based work.

  29. Adding features, fighting fires « Statistics Open For All Says:

    [...] 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/. [...]

  30. Chriki™ Says:

    Thank you very much for posting this tip! This bug is really nasty.

  31. Srinivas Says:

    Thank you very much. It worked. You have saved quite some time.

  32. Amoraleda Says:

    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. :D
    Bye!

  33. Use softlinks « Deorbit's Blog Says:

    [...] 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/ [...]

  34. Paolo Says:

    thanks a lot! This perfectly worked :)

  35. jmie Says:

    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.

  36. Django Trip: Django with Eclipse, Pydev, Aptana and virtualenv « Code Buzz Says:

    [...] first line is needed to fix a bug. Read more here if you want to know [...]

  37. Deepak Says:

    wow !!! thanks for the wonderful tip…i had almost given up trying to fix this

  38. Suds Says:

    Nice Find! Thanks a lot.

  39. kiwi11000 Says:

    My Hero. GREAT!

  40. coder111 Says:

    Wow, thanks, this really helps

Leave a Reply