11

I am running Ubuntu 16.04 LTS, with the latest version of Eclipse installed from their website. In the Unity Launcher bar to the left, I can't get the icon for Eclipse to be anything except a question mark. I have created a .desktop file with the appropriate paths for Exec= and Icon= , and I have made the item executable via chmod. The functionality of the .desktop file is not a problem. I just can't get the icon that shows up to change.

The name does change from Eclipse to Workspace Launcher when Eclipse finally starts. Any help would be much appreciated.

EDIT: the code:

[Desktop Entry]
Exec=/home/**removed**/eclipse/java-mars/eclipse/eclipse
StartupNotify=true
Terminal=false
Type=Application
Icon=/usr/share/icons/eclipseIcon.xpm

*username removed for security purposes.

EDIT: Reinstalling fixed any and all Eclipse problems that I had.

0

9 Answers 9

7

I have been able to resolve this by just removing the eclipse.desktop file from ~/.local/share/applications and then exiting and launching eclipse again:

I followed this solution: https://askubuntu.com/a/735924

2
  • This worked for me. I freaked out a little after my icon's image turned to a "?", but then it went back to the STS icon.
    – AFP_555
    Dec 5, 2017 at 13:34
  • @Baalmart Worked like a charm Sep 17, 2020 at 10:27
6

I had a similar problem. I tried ScottC's answer mentioned here. I created the .desktop file on my desktop location, added the exec path as <eclipse installation directory>/eclipse and icon path as <eclipse installation directory>/icon.xpm and then pinned it to the launcher. This worked for me.

1
  • Thanks for the nice answer. A detailed answer is appreciated.
    – Pupil
    Sep 18, 2018 at 11:37
0

I never had those problems. I have my desktop file in the eclipse folder, copy and modify it from version to version and than drag&drop it from nautilus to the launcher. Here is my eclipse desktop file:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/home/USERNAME/Apps/eclipse-neon/eclipse --clean -vm /usr/lib/jvm/java-8-oracle/jre/bin -vmargs -Dfile.encoding=UTF-8 -Xms256m -Xmx3000m -XX:+UseG1GC -XX:+UseStringDeduplication 
Name=Eclipse JEE neon
Icon=/home/USERNAME/Apps/eclipse-neon/eclipse-neon.png
Name[de_DE]=Eclipse JEE Neon

You also want my custom eclipse neon logo, it's great! ;) here you go: https://i.stack.imgur.com/IoBJs.jpg

0

The icon entry must have a fully qualified path to the actual XPM image file. If you keep your eclipse folder in your home directory, the eclipse.desktop entry becomes:

Icon=/home/USERNAME/eclipse/icon.xpm

Annoyingly, Neon ships with the Mars icon. This will make you sad and miss the planetary theming, if left unchanged.

For example, Neon for Android should have a green accent:

https://i.stack.imgur.com/KyrBO.jpg (use GIMP to convert this PNG to XPM, default alpha).

You should never adulter the blue&white Eclipse logo, that is blasphemy. The accent is now agnostic since the planet theme was abandoned. Phobos would have been the perfect name for an Eclipse release ...

0

I just faced the same problem and solved it by changing the name of the Icon name in the desktop file. Using Ubuntu 16.04.3 and Eclipse Oxygen and by looking at the eclipse folder, I saw that the icon has the name 'icon.xpm' , whereas in the desktop file in

~/.local/share/applications, the name is 'eclipse'.
So, I replaced:
Icon=eclipse
by:
Icon=$your_eclipse_path/icon.xpm

and it worked for me.

0

In the sample you have mentioned in the top, the required key "Name" is missing. In Ubuntu 16 when I execute desktop-file-install command it fails with the following error:

/usr/share/applications/eclipse.desktop: error: required key "Name" in group "Desktop Entry" is not present

To solve that you need to add the "Name" entry

Name=Eclipse
0

Add desktop entry for launcher here(/usr/share/applications/eclipse.desktop) with changes in icon and exec path. Even your problem exist, try this one

remove space in your exec and icon path or use back slash Ex:
Exec=/home/<some dir>/eclipse Mars/eclipse
         **->/home/<some dir>/eclipse\ Mars/eclipse**
0

Add desktop entry for launcher here(/usr/share/applications/eclipse.desktop) with changes in icon and exec path. Even your problem exist, try this one

remove space in your exec and icon path or use back slash Ex: Exec=/home//eclipse Mars/eclipse ->/home//eclipse\ Mars/eclipse

0

The .desktop file must be at $HOME/.local/share/applications.

See this answer and the original source.

You must log in to answer this question.