This question is related to this one: Ubuntu 16.04 Eclipse launcher icon problems, however I have installed Eclipse and STS.
I have created a .desktop
file for each of them, basically just copy-pasting and changing the paths for them. My Eclipse IDE icon is showing but STS isn't, here's a SS showing what I mean:
Here are both of my .desktop
files:
Eclipse.desktop:
[Desktop Entry]
Type=Application
Name=eclipse
Comment=Eclipse IDE
Icon=/app/tools/eclipse/eclipse/icon.xpm
Exec=/app/tools/eclipse/eclipse/eclipse
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=eclipse
STS.desktop:
[Desktop Entry]
Type=Application
Name=STS
Comment=Spring Tool Suite
Icon=/app/tools/spring-tool-suite-3.9.1.RELEASE-e4.7.1a-linux-gtk-x86_64/sts-bundle/sts-3.9.1.RELEASE/icon.xpm
Exec=/app/tools/spring-tool-suite-3.9.1.RELEASE-e4.7.1a-linux-gtk-x86_64/sts-bundle/sts-3.9.1.RELEASE/STS
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=STS
As you can see, both of them are practically identical except for the paths and names.
I made both of them following the accepted answer in this question: How to pin Eclipse to the Unity launcher?
Something curious is that if I use the "search" option, I can see the app with the icon but not on the Launcher, how to solve this? So I can pin it to the Dock?
While I'm familiar with Ubuntu, I've used it on 16.04 and earlier versions and it "automagically" showed the icon for me when downloaded and installed, so this was something strange for me this time.
It seems
STS
is not a correctStartupWMClass
value in theSTS.desktop
file.To get a correct value first switch to an Xorg session and launch Spring Tool Suite. Then open Terminal and run
xprop WM_CLASS
, place the cursor over the STS window and click. You should get correct values for Spring Tool Suite in the Terminal window asYou should get something like the following in particular
Then change the
StartupWMClass=STS
line toStartupWMClass=Spring Tool Suite
in theSTS.desktop
file and save it.In March 2022, latest STS download Spring Tool Suite 4 Version: 4.14.0.RELEASE
i had to change :
Exec=/PATH_TO_MY_EXTRACT_DIRECTORY/sts-bundle/sts-3.9.1.RELEASE/STS
To:
The executable is called "SpringToolSuite4" now
StartupWMClass=STS
works as well as
StartupWMClass=Spring Tool Suite
Fyi lsb_release -a
And STS version: