Ubuntu – Help adding app to favourites

favoritesgnome-panelgnome-shellubuntu-dockubuntu-gnome

Ubuntu 20.04 on Hyper-V VM

I have tried following this but having no luck. The file shows in the app drawer but nothing happens when I click it. Here is what I have in my jmol.desktop file.

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Jmol
Comment=Jmol-14.31.0
Exec=/home/adamch/Downloads/Jmol-14.31.0-binary/jmol-14.31.0/Jmol.jar
Icon=/home/adamch/Downloads/Jmol_icon_win.ico
Terminal=false
StartupWMClass=Jmol

The app works in the terminal by using java -jar Jmol.jar so is there a way to put that in the .desktop file and make it work?

Best Answer

Use the Path key to change the working directory and run java -jar Jmol.jar:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Jmol
Comment=Jmol-14.31.0
Exec=java -jar Jmol.jar
Terminal=false
StartupWMClass=Jmol
Path=/home/adamch/Downloads/Jmol-14.31.0-binary/jmol-14.31.0/
Hidden=false
Related Question