After an upgrade to Ubuntu 9.10 (Karmic Koala) I noticed a few random issues in Eclipse has popped up. Most notably, I was no longer able to click the OK buttons on pop up windows – I had to highlight them with the mouse then hit either space or enter on the keyboard to select them.
Other symptoms included the “Install new software” window not listing any options when I entered an update URL (the options were there, but just not visible – clicking randomly within the selection box seemed to activate/deactivate them). Also the buttons were missing from the search view, so I was no longer able to scroll through the results after a full file search.
Initially, I thought this may have been a Java incompatibility with Karmic – I’d installed the Beta version on the my desktop PC weeks before and experienced the same issue, but assumed it was because the OS wasn’t finished.
But after a bit of digging around, I found a bug logged on the Ubuntu Bug tracker. A post by Holger Berndt seems to confirm the bug is in Eclipse:
Starting from 2.18 on, GTK+ changed some of its internal behaviour (google for “client side windows”). This change is intentional, and needed for other development. It doesn’t make any difference to programs using GTK+ correctly, but it makes problems with programs that use GTK+ in weird ways, making wrong assumptions that only accidentally worked in the past. So, to ease the transition until those programs get fixed, an environment variable has been introduced to simulate the old behaviour.
Reading through the rest of the discussion, it turned out that
won’t shouldn’t affect copies of Eclipse checked out from the Ubuntu package repository, but seeing as I was using a copy of PDT I’d got straight from the Eclipse website, I was seeing the problems.
The fix is relatively simple. Create a file in your home folder (or wherever you want) called
eclipsefix.sh – open it and add the following lines:
export GDK_NATIVE_WINDOWS=true /opt/eclipse/eclipse
/opt/eclipse/eclipse is the location of your eclipse application file).
Make sure you make it executable (
chmod +x ~/eclipsefix.sh) then go to whatever shortcut you usually use to open Eclipse and change the command to point towards the file you just created (ie,
Now whenever you open Eclipse using this shortcut, the script will run and eclipse should work as expected.
According to the eclipse bug tracker, this issue should be fixed in Eclipse 3.5.2
Update 11/11/09: daYmo has commented that to get it to work he had to use
export GDK_NATIVE_WINDOWS=1, so if you have no luck the first time it may be worth giving this a try.
Good eclipse packages for ubuntu (jaunty, karmic)
Thanks SO MUCH for this information. I couldn’t figure out why nothing was working, and this fixed the problems. It’s a HUGE help!
I tried your solution but, it did not work
thats what I set up, am I missing something?
Not sure – did you get any sort of error message when you run it?
yes, we’re gettin this error…
A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x002bd856, pid=4776, tid=3078371008
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing linux-x86 )
# Problematic frame:
# C [libpango-1.0.so.0+0x23856] pango_layout_new+0x36
any fix ?
Not sure my friend, I don’t know a lot about Java. Sorry.
THANK YOU !!!
i am very grateful for this post 🙂
the bugs i observed were
a) clicking run inside run configurations dialog did nothing
b) clicking find or replace inside find and replace dialog did nothing
now these things work again.
awesome! thank you so much!
Awesome that fixed my problems
Thank you for this rather helpful post. The button issue was rather annoying. I am looking forward to the eclipse 3.5.2 release…
Thanks a lot!Great help!
Thanks very much! I was pulling my hair out…..
Thanks so much. I was about to reinstall the whole machine. Thank god for Google and people like you. Thanks again.
Thanks for the tip.
I am noticing, however, that I don’t see the icons in the contextual menu right click-new (the new file list used to have an icon for the default files). Can you see the icons?
It’s a Gnome 2.28 issue.
Start gnome-appearance-properties select the Interface tab and activate the option ‘Show icon in menus’
Btw. thanks for the blog on eclipse issue with karmic. 🙂
Yeh, ,me too. The export did not solved it.
Thanks so much.
What a helpful post. You’ve helped me finish this big headache. In my office things are so full of stress and this issue was squeezing my nerves!
Saludos from México. 😉
Thanks, I’ve had tons of small issues with eclipse after moving to 9.10, find not working as expected, no console even with printlns firing…
BTW How does one find your flickr stream from here? Cool pics, was thinking of adding you as a contact.
The “more” link under the photos in the sidebar should take you to my flickr page. 🙂 Glad you like!
Thank-you so much!!! I am migrating to Ubuntu Studio after the Windows Vista failure, and then Windows 7 not being great enough. Unfortunately, I couldn’t get Eclipse to work, but now it is! Thank-you so much for posting this!!
Buttons where annoying that I should press enter after click.
With that shell script, everything worked normally for me. Thanks.
I know what you mean, clicking then having to hit “enter” was becoming a bit of a pain in the ass. 🙂
You dude 🙂 Thanks very much.
Thanks much man. Helped a lot.
Ach, you’re so bloody clever 😛
You love it 😉
Great!! It worked for me, thank you!
now im falling in love back to my eclipse + karmic
thanks alot lot lot
Thanks dude! Useful bit of information.
your script doesn’t work on my computer.
have to use that one :
Cheers for the info, I’ll update the post
Thank you so much.
Such inadvertent changes can take you hours…
It’s amazing! nock down my headache!
Thanks! This problem also affected my Google Chrome browser. The browser’s drop-downs weren’t populated, but I put the GDK_NATIVE_WINDOWS variable in my .bashrc and now both Eclipse and Chrome behave as expected.
Thanks You Save My Time Thank to you very much Dear…….
THANK YOU !!!
i am very grateful for this post!
Hi, Thanks for your post. I’ve added GDK_NATIVE_WINDOWS in .bashrc; but it doesn’t work for me.
Hi thx for this helpful post.
this works fine for me with double click; the shortcut launcher point to eclipsefix.sh and it doesn’t work.
how can i create that shortcut launcher?
thanks it works saved my day
Thank you so much!
worked for me, thanks a lot
It works for me!
seemed to work for me. problem was driving me nuts! thanks.
Much appreciated 🙂
BTW, if the script does not work then
just press enter (keyboard).
I`ve tried with this script (in the two ways with “export GDK_NATIVE_WINDOWS=1” and “export GDK_NATIVE_WINDOWS=true”) but I didn`t solve the problem.
I have ubuntu 9.10 and Eclipse Ganymede (latest version)
I´d a mistake and the script runs well.
Sorry and thank you
It worked for me Using Fedora 12, KDE4 and the latest Eclipse PDT 20090920-1017.
Thanks a lot 🙂
thank!! I resolved my problem. Thank again
Hi, thanks for the write-up, you saved me lots of digging around.
Here’s another way to flag GDK_NATIVE_WINDOWS without having an extra script lying around. If you start Eclipse via a launcher or a menu, then you can simply add the following in the eclipse.desktop file:
Exec=env GDK_NATIVE_WINDOWS=true /path/to/eclipse
Depending on the mode of installation, eclipse.desktop may be found in /opt/eclipse, /usr/share/applications, /usr/local/share/applications, or perhaps even ~/.local/share/applications.
you made my day, thanks 😉
In Persian we say: “Khoda (=God) kheiret (=best things for you) bede (=give)”
This solved my problem with some actions on the Eclipse GUI but there’s still one more thing I can not make work well and it’s about input fields.
For example I can’t put a new url for SVN repositories. The input fields looks like disable so it’s impossible to write or select it.
Is this an issue about this variable or I’m missing something else?
Thanks in advance…
I noticed that the combo-box input type is the form object that can’t yet work.
Did someone found this same error?
Thanks, works great!
I also noticed this problem in the Android SDK’s “android” tool, which uses Eclipse’s GUI toolkit.
Without your trick, the cumbersome way to achieve things was to:
– Press after every unresponsive button click
– Resize the window whenever an area does not show the information it should show (such as in the Software Update)
Thanks so much – works great on Ubuntu and Open Suse
This has being a rather annoying issue. Thanx for taking time to put the solution in to words.
Thanks so much – solved the problem immediately after many weeks of verbal abuse and misplaced anger endured by the poor little rodent on my desk.
Ah – it’s the small things, I tell you!
Thank you for the GREAT help!
Thank you. Worked perfectly.
Thank you sooo much for this answer! I set my environment variable and everything worked great! I am using Ubuntu 9.10 w/ jdk 1.6.0_16 and nVidia dual monitors and Eclipse Galileo (3.5.1.M20090917-0800) downloaded straight from Eclipse.org website.
Thank you. This post heled me to run eclipse 3.1.1 on debian lenny.
Muchas gracias man !!
Thanks a lot man !!
Thanks! Saved a few strands of hair from getting pulled out in frustration!
thanks man! it really helped me out!
what about the icon problem with the default files?
does anybody solved it?
This fix helped me a lot.
Thanks so much for posting this, I need 3.1.1 for an old plugin and had the exact problem. Now solved thanks to you! All the best
Script work’s otherwice but it doesn’t pass filepath to open for eclipse -> can’t open files with eclipse using that script.
Any who can help with that?
It is working nicely..
Thank you very much..
This was driving me nuts. You rock, dude.
I have a minor variation for people like me that have a dozen or so workspaces with launchers all over the place for them. Just edit the launcher command to add -DGDK_NATIVE_WINDOWS=1 to the command, a full example is:
/opt/eclipse/eclipse -DGDK_NATIVE_WINDOWS=1 -data /home/roger/workspace
Under Lucid this made the difference between debug buttons appearing and not appearing.