Ubuntu – .desktop file does not show the icon in applications

desktopeclipseiconslauncher

I have created a .desktop file for Eclipse and put it in .local/share/applications in applications launcher the icon of app is not showing up.

[Desktop Entry]
Type=Application
Name=Oxygen_Eclipse
Comment=Eclipse Integrated Development Environment
Icon= /home/amir/IDE/OXYGEN/eclipse/icon.xpm 
Exec= /home/amir/IDE/OXYGEN/eclipse/eclipse 
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Oxygen_Eclipse

I have the same .desktop file for eclipse Luna (with path to luna folder) and that one shows the icon. I have tried .png file and another .xmp icon none of them work.

Best Answer

I had a similar issue and I fixed it by removing a stray whitespace character at the end of the Icon line. It looks like there is whitespace in you paths, what happens if you try

[Desktop Entry]
Type=Application
Name=Oxygen_Eclipse
Comment=Eclipse Integrated Development Environment
Icon=/home/amir/IDE/OXYGEN/eclipse/icon.xpm
Exec=/home/amir/IDE/OXYGEN/eclipse/eclipse
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Oxygen_Eclipse