5

I recently installed the latest version of Eclipse that I downloaded from the Eclipse website. It is located at /opt/eclipse. I have a symbolic link form /usr/bin/eclipse to /opt/eclipse/eclipse. I also have a file named eclipse.desktop in /usr/share/applications, whose contents are as follows:

[Desktop Entry]
Name=Eclipse
Comment=Eclipse C++ IDE
Exec=/opt/eclipse/eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Development;
StartupWMClass=Eclipse

/opt/eclipse/icon.xpm exists. However, the icon is not shown in the dock or in the list of applications. Any ideas? I'm on Ubuntu 14.04.

EDIT: Tried updating StartupWMClass, doesn't help. Here's a screenshot that captures the situation:

[enter image description here]

Jacob Vlijm
  • 85,475
SPMP
  • 187

2 Answers2

3

I am pretty sure you have another eclipse.desktop file in ~/.local/share/applications. The one you show in the image looks fine. Most likely, you ran Eclipse a single time before moving it to /opt. Then a .desktop file is automatically created in ~/.local/share/applications.

.desktop files in ~/.local/share/applications overrule global ones in /usr/share/applications, which means that whatever you change to the global one, it has no effect whatsoever; the one in ~/.local/share/applications takes precedence ans is the one that shows in the Launcher.

If so, remove the one in ~/.local/share/applications, log out and back in.


EDIT


After your latest comment, it becomes clear what happened: It turns out you previously made a local launcher with alacarte. Alacarte does not handle icon paths correctly when using absolute paths; alacarte simply leaves out the icon's extension, but extensions are needed when using absolute paths.

See also here.

Jacob Vlijm
  • 85,475
3

I had the same issue which wasn't solved by any of the above but by not enclosing the path to the icon file in quotes (there were no spaces in the path or file name). Icon was then displayed as expected. The exec line handled quotes fine though.

ie changed

Icon="/path/to/file/icon.xpm"

to

Icon=/path/to/file/icon.xpm
anonymous2
  • 4,325
user680127
  • 31
  • 2