5

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:

enter image description here

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?

enter image description here

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.

0

2 Answers 2

3

It seems STS is not a correct StartupWMClass value in the STS.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 as

WM_CLASS(STRING) = "value1", "value2"

You should get something like the following in particular

WM_CLASS(STRING) = "Spring Tool Suite", "Spring Tool Suite"

Then change the StartupWMClass=STS line to StartupWMClass=Spring Tool Suite in the STS.desktop file and save it.

1

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:

 Exec=/PATH_TO_MY_EXTRACT_DIRECTORY/sts-4.14.0.RELEASE/SpringToolSuite4 

The executable is called "SpringToolSuite4" now

StartupWMClass=STS

works as well as

StartupWMClass=Spring Tool Suite

Fyi lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:    21.10
Codename:   impish

And STS version:

Spring Tool Suite 4 
Version: 4.14.0.RELEASE
Build Id: 202203131612
OS: Linux, v.5.13.0-37-generic, x86_64 / gtk 3.24.30
Java vendor: Eclipse Adoptium
Java runtime version: 17.0.2+8
Java version: 17.0.2

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.