By default, the popular Eclipse IDE does not support the Ubuntu AppMenu or  HUD. The reason for this is that Eclipse has been blacklisted so it wouldn't use the AppMenu around the time of Ubuntu 10.10 Maverick Meerkat because it didn't work back then.

Now Eclipse does work with the AppMenu, however, there are some minor glitches like some menu shortcuts not being displayed (although they do work). If this isn't a problem for you, here's a quick way to whitelist Eclipse so it can make use of Ubuntu's Appmenu and HUD.

Below you can see Eclipse IDE with global menu and HUD support running in Ubuntu 13.04:




HUD and AppMenu support for Eclipse IDE in Ubuntu


The ideal solution would be to rebuilt AppMenu from source with Eclipse whitelisted by default, but since that's considered complicated by most users, here's an easier solution.

The instructions below should work with any Ubuntu version.


1. To get Ubuntu AppMenu (global menu) and HUD support for Eclipse IDE, we'll have to whitelist it so we'll hve to modify the GTK2 libappmenu.so file. 

To find out the exact GTK2 libappmenu.so path (the path can vary depending on the Ubuntu version you're using and architecture), firstly run the following command:
sudo updatedb

Once it finishes (there's no output so just wait until it's done), let's find the GTK2 libappmenu.so path by using the following command:
locate "gtk-2.0/2.10.0/menuproxies/libappmenu.so"
The above command should return the exact GTK2 libappmenu.so path.

2. Let's make a backup before proceeding, so using the path returned by the command above, run the following command:
sudo cp /path/to/gtk-2.0/2.10.0/menuproxies/libappmenu.so /path/to/gtk-2.0/2.10.0/menuproxies/libappmenu.so.bak

3. Now let's whielist Eclipse so it supports AppMenu and HUD:
sudo sed -i 's/Eclipse/Xclipse/g' /path/to/gtk-2.0/2.10.0/menuproxies/libappmenu.so

For the last to commands above, remember to use the exact path to the GtK2 libappmenu.so you've found under step 1!

Alternatively, you can also use a PPA which comes with a package that basically  runs all these commands automatically but: the PPA may give you the wrong impression that if you remove the package, everything is reverted and in fact it's not; also, you'll still have to reinstall the package if Appmenu Gtk2 is updated (so by the way, you'll have to follow these instructions again if that package is updated); and finally, the PPA package doesn't work correctly for Ubuntu 12.04. That's why I've preferred the manual instructions over the PPA.


That's it! Now restart Eclipse IDE and it should now support the Ubuntu appmenu (global menu) and HUD.

Note: if the AppMenu package is updated, you'll have to reinstall the "eclipse-enable.appmenu" package.

If later on you want to disable appmenu / HUD support for Eclipse IDE (undo the changes), simply follow the first step above to find out the GTK2 libappmenu.so path and restore the backup we've made under step 2 using this command:
sudo cp /path/to/gtk-2.0/2.10.0/menuproxies/libappmenu.so.bak /path/to/gtk-2.0/2.10.0/menuproxies/libappmenu.so

And then, restart Eclipse IDE.


solution via Launchpad bug report (thanks to Vasile Rotaru)

0 comments:

Post a Comment

 
Top