Ubuntu: [Manual shortcut]Bad interpreter



Question:

I downloaded 64-bit(it's compatible with my system etc.) Sublime Text from their official website,extracted tar file and opened new folder.There wasn't install file but executable did.I created symbolic link() to /usr/bin by typing following line in terminal: sudo ln -s [path of original] /usr/bin/stext (here stext is my arbitrary name for link). Everything works ok(I checked this executable works fine), but after I created desktop shortcut manually(via text editor) and allowed execution by typing:

sudo chmod +x Sublime Text Editor.desktop  

I had following problem: (I also tried this with sudo) ./Subline Text Editor.desktop it tells me bad interpreter:such file or directory doesn't exists Now here is what I entered at .desktop file:

#!usr/bin/env xdg-open    [Desktop Entry]  Exec=/usr/bin/stext  Version=1.0  Type=application  Icon=/home/pc/Downloads/sublime_text_3/Icon/256x256/sublime-text.png  Name=Sublime Text Editor  Terminal=false  Categories=Application  

Now, maybe I changed order of instructions or what?I assume that problem is (like it says) at the first line: bad interpreter instruction. I know that first line is important to tell program which interpreter should be used, but anyone knows which one is appropriate for this task?

So, I emphasize that editor works, but I wish shortcut on Desktop and to completely figure out how to create it MANUALLY.


Solution:1

You did it wrong.

The correct desktop file Subline_Text_Editor.desktop should contain only last lines:

[Desktop Entry]  Exec=/usr/bin/stext  Version=1.0  Type=Application  Icon=/home/pc/Downloads/sublime_text_3/Icon/256x256/sublime-text.png  Name=Sublime Text Editor  Terminal=false  Categories=Application  

There is no need to have header line (#!usr/bin/env xdg-open in your case).

You do not need sudo to make it executable.


Solution:2

Problem fixed! 1) Instead of Type=application there should be Type=Application 2) We can not run .desktop file from terminal.

(.desktop file :line 1: [Desktop: command not found) helped me so much. @N0rbert That for last lines isn't true, I checked it: Name of .desktop file: "S T E.desktop" (with spaces), name inside code: "Sublime Text Editor"-this worked. But anyway, thank you for help.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »