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]

6
  • This usually happens if one of the fields is invalid. What happens if you change the Exec= line into /opt/eclipse/eclipse? (or if you run from a terminal: eclipse, or /usr/bin/eclipse) Feb 17, 2016 at 19:20
  • Changing to /opt/eclipse/eclipse doesn't fix it. I have never had a problem running eclipse with this link. The only issue is that the icon doesn't show up.
    – SPMP
    Feb 17, 2016 at 20:03
  • Ah, do you mean a launcher without an icon, or no launcher at all? Feb 17, 2016 at 20:06
  • The launcher has an icon of a sheet of paper. When eclipse is running, a question mark appears on the dock.
    – SPMP
    Feb 17, 2016 at 20:23
  • When I use the Alt+Tab task switcher, icons for all other tasks show up fine, but there is nothing showing for eclipse.
    – SPMP
    Feb 17, 2016 at 20:24

2 Answers 2

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.

11
  • Thanks for the answer. Doesn't help though. I've updated the question with a screenshot.
    – SPMP
    Feb 17, 2016 at 21:27
  • @user2308211 See my updated answer. I understood the generic icon appeared while running Eclipse, but your image shows it has no icon at all. Feb 18, 2016 at 6:28
  • 1
    Thanks!! Here's what was happening: There were no eclipse.desktop files, but there were quite a few alacarte-made**.desktop files from my previous attempts using the GUI launcher creator. Deleted all of those, and the icon shows up fine.
    – SPMP
    Feb 18, 2016 at 20:05
  • @user2308211 perfect! One of them must have been the one in the launcher :) Feb 18, 2016 at 20:08
  • One other concern though. I'm using the compiz application switcher, so that I can see each window (for example different Google Chrome windows) as a separate entity in Alt+Tab. Usually, the icons show up when I do Alt+Tab, but that one is still empty for Eclipse. Any ideas?
    – SPMP
    Feb 18, 2016 at 20:14
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
2
  • This is good information for those who have a blank icon and a .desktop file with quotes in the line as in your example as I can confirm quotes can blank the icon, however if you check the OP's post, you'll note that this is not the case for them. This information would have been more accessible and useful as a self answered Q&A.
    – Elder Geek
    Apr 19, 2017 at 22:48
  • This worked for me. Thanks for solving my problem.
    – Pupil
    Sep 18, 2018 at 11:47

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.