Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I run gnome shell 3.6 and Eclipse 4.2. I installed Eclipse manually, in my /opt directory, because the Ubuntu package for Eclipse is very outdated.

I've created a .desktop file for it, and placed in in ~/.local/share/applications. It looks like this:

[Desktop Entry]
Comment=Eclipse Integrated Development Environment

I can run Eclipse from the Activities menu; if I hit the super menu and type in "Eclipse" and run it, it starts just fine, and shows up in my launcher/sidebar/dock/whatever it's called.

But if I right-click on its icon, there is no "Add to favorites" option.

(I notice this is also the case if I run some very old programs, like xeyes and xcalc. it's amazing these are still distributed!)

So what is it about a program that determines whether or not the "Add to favorites" option is available? if I knew and understood that, maybe it'd set me on the right path to fixing this Eclipse problem.

share|improve this question

5 Answers 5

up vote 11 down vote accepted

Found the answer elsewhere. The .desktop file needs to be named EXACTLY the same as the binary that's launching.

Mine was something like eclipse_ide.desktop and the binary that runs is just "eclipse". Gnome shell does not seem to like that.

share|improve this answer
For future reference, this answer did not solve it for me. The only way I could do it was right-clicking the application from the actual "Applications" menu and adding it as a favorite. I could not do it while the program was running on the dock. –  jflory7 Jan 8 at 13:06
  1. Install alacarte program.
  2. Run this program (its name is Main Menu).
  3. In the appropriate Menu category from right side panel add your eclipse menu item (by introducing icon, name and command)
  4. Now gnome shell show your manual installed eclipse in its search and you can search it or add it to favorite easily.

It works for all manual installed program in gnome shell.

share|improve this answer
This is a good, painless way. Thanks! –  lppier Sep 21 at 9:31

Be sure the Icon=/opt/eclipse-4.2.1/icon.xpm line in the .desktop file points to the right file. That was the problem in my case.

share|improve this answer

I found that if I right-click the app when it appears in the search "Add To Favorites" is available: Create its *.desktop file to make it available in the "Activites" overview -> Press "Activities"/super key -> Type app name -> Right Click it as it appears in the search -> "Add To Favorites" should now be available.

In my case I had this problem with Android Studio (android-studio/bin/ running gnome-shell 3.16.2-2.

share|improve this answer

In Gnome 3.16 I managed to add an application to favorites by naming the .desktop file exactly as the window WM_CLASS.

To know the window WM_CLASS:

  1. open a terminal window
  2. execute the xprop command: the cursor turns in a cross
  3. click on the relevant window
  4. read the command output in the terminal, looking for the WM_CLASS property (it is a comma separated list of values, just pick the first one)

In case you are using multiple versions of Eclipse at once and you get conflicting WM_CLASS values (typically "Eclipse" for any version, AFAIK), you can set your own (i.e. "Eclipse Luna") by editing the relevant plugin.xml in the Eclipse package you installed.

I.e. for Eclipse Luna JEE the file to edit is <install_dir>/plugins/org.eclipse.epp.package.jee_4.4.<some_version>/plugin.xml

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.