When I try to execute this file:

[Desktop Entry]
Name=Shiginima Launcher
Exec=java -jar /home/edoardo/Scrivania/Giochi/Minecraft/Shiginima\ Launcher\ SE\ v3.100.jar

with gtk-launch, it starts loading and after it crash (without opening).

Furthermore if I execute the .desktop file (the same file) inside a terminal, it return an output like this:

/home/edoardo/Scrivania/Giochi/Minecraft/launcher.desktop: line 1: [Desktop: command not found
/home/edoardo/Scrivania/Giochi/Minecraft/launcher.desktop: line 4: Launcher: command not found
/home/edoardo/Scrivania/Giochi/Minecraft/launcher.desktop: line 6: -jar: command not found

How can I fix it?

If it can be useful: my screenfetch

  • 3
    Your "furthermore" test is just telling you that .desktop files aren't shell scripts, and can't be executed as such - a more useful test would be whether you can execute java -jar /home/edoardo/Scrivania/Giochi/Minecraft/Shiginima\ Launcher\ SE\ v3.100.jar in a terminal Jul 14, 2017 at 0:01
  • Although preceding the .desktop file proper with #!/usr/bin/xdg-open does work and is quite a fun thing I hadn't thought about until now...
    – Christian
    Jul 14, 2017 at 0:14
  • @Christian I added this line as first line, now no errors on the terminal (no output) but it does not work anyway. Jul 14, 2017 at 17:29
  • Did you try just getting rid of the backslashes that escape the spaces?
    – Christian
    Jul 15, 2017 at 14:43
  • with both java -jar "/home/edoardo/Scrivania/Giochi/Minecraft/Shiginima Launcher SE v3.100.jar" and java -jar /home/edoardo/Scrivania/Giochi/Minecraft/Shiginima Launcher SE v3.100.jar it does not work Jul 16, 2017 at 17:00

2 Answers 2


Like the comments told you, your test is only showing that the .desktop is not a shell script. That's why you get all those errors aswell as why you get the -jar command not found since in that test you actually set a variable "exec"="java" afterwards the shell tries to run -jar which it doesn't find.

So first of all try

 java -jar /home/edoardo/Scrivania/Giochi/Minecraft/Shiginima\ Launcher\ SE\ v3.100.jar

If that doesn't work you might need to look into that first of all.

Also you can set your Terminal=true for now, so you actually get an output when you click on the .desktop file so you are able to see what is happening.

  • The command in the Exec parameter works fine but if I set Terminal=true nothing change. Jul 14, 2017 at 17:32

I'm using XFCE with Linux Mint. But I noticed that when I opened the file Properties of the .desktop file... it was saying: "Opening with text editor".. anyway it was fully broken.

So naturally you might want to drag & drop the desktop file to to your terminal to check for more info. But that would NOT work. Since you can't execute a .desktop file within your terminal. This is why it shows you the errors you got in your terminal output.

Instead. I check the application/x-desktop MIME type in the "Default Applications" app. Which is set to a wrong value.

I opened the /home/$USER/.config/mimeapps.list file and manually removed the application/x-desktop= line from this file (under the "[Default Applications]" section).

I also removed the application/x-desktop= line under the "[Added Associations]" section.

Finally, I saved the file again.

Then I updated the mime.cache by running the command:

sudo update-desktop-database

Apparently the default application under XFCE at least is "Create launcher on panel"? Which I still find uh.. incorrect.

enter image description here

Ps. In some cases you might want to try to enable "Run in terminal" at your launcher settings.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .