Icon assigned in .desktop file is not used when application is loaded and launcher icon appears

Solution 1:

Why did you create your desktop file in ~/applications directory? This desktop file should be placed into /usr/share/applications or into ~/.local/share/applications.

The right and successful way to do this is to use Main Menu (it can be installed with sudo apt-get install alacarte command). Search for it in Dash or you can open it from Terminal with this command:

alacarte

After it opens, follow the instructions in the image below:

alacarte

You can check after in ~/.local/share/applications if you have a new desktop file for Eclipse Juno. The name of the new fesktop file should be something like alacarte-made-x.desktop (where x is a number). And now if you want a copy of this file in your ~/applications directory, you can copy it there without no problem.

And another one important thing: use the full path to the application for command (Exec=/path/to/eclipse) in both desktop files.

See also:

  • https://developer.gnome.org/integration-guide/stable/desktop-files.html.en
  • https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
  • http://www.frankrock74.it/frankrock74/?p=1738 (in Italian language)