I have an eclipse installation that was not installed through the repositories. To be able to launch it conveniently,

  • I symlinked the path to eclipse to /usr/bin, (so that it can be started by running the command eclipse from a terminal)
  • I created a .desktop file, to start it from the dash.
  • After starting from the dash, I locked the icon that appeared to the Launcher.

This all works, the icon specified in the .desktop file shows (after some trial and error) and everything.

However, when I run eclipse from terminal, it does not use the item that I locked to the Launcher, but creates a new one. When I start Eclipse through the dash, it does use the item locked to the Launcher. Furthermore, when running eclipse from the terminal, it apparently does not know which icon to use, since it shows a grey sheet with a question mark instead.

I would like Ubuntu to recognize that I'm executing the same command in both cases, and have it treat them identically. How can this be achieved?


Not 100% sure on Unity, as I don't have an install to test with. However this works on Gnome on 14.10.

gtk-launch eclipe

assuming your desktop file is eclipse.desktop. If not just change eclipse to whatever you named the desktop file without the .desktop extension

  • Surprisingly, the result depends on whether eclipse is already open. If I first start eclipse from the dash or the launcher and then start a second instance using gtk-launch eclipse, it is grouped under the same (pretty) icon in the launcher. However, if I run eclipse first (resulting in the ugly questionmark icon), and then run gtk-launch eclipse, it is grouped under that icon. If I run it on its own, without having another instance of eclipse, it gives the questionmark icon, so that's visually the same as running eclipse. – tjalling Apr 13 '15 at 6:57

It seems that the issue was that there were multiple .desktop files for the same Eclipse executable. Deleting all but one of them solved the issue.

If you launch Eclipse before creating a .desktop file, then right-click that Eclipse in the launcher and click Lock to launcher, Ubuntu goes about this by automatically creating a .desktop file for you, behind the scenes.

If you unlock it from the launcher later on, the auto-generated .desktop file is not removed. Of course, if you then manually create a .desktop file, there are two .desktop files, and this may result in the behaviour described in the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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