user@laptop ~ $ sudo ln -s ~/Games/JA/openjk.i386 ~/Desktop/JA
user@laptop ~ $ readlink -f ~/Desktop/JA

As you can see, the symlink points to the file, but when I try to click on it it doesn't work. However, if I put the JA symlink in the same directory as the file it is linking to (in this case ~/Games/JA) it works. How do I make it work outside that directory (in the Desktop, for example)?

  • First of all, don't use sudo for this, that means the link will be owned by root, not your user and you don't need it anyway. Is this exactly what you're doing? I just repeated it and it works as expected on my Debian. Do you have access to all directories in question? What happens when you click on the link? What should happen? What kind of file is openjk.i386? – terdon Mar 4 '14 at 21:31

The problem surely is, that the binary openjk.i386 surely expecting some files in its directory. But the binary assumes, that its directory is ~/Desktop/, where the required files are not found.

I would recommend using a very small script instead of a symbolic link. E.g. it should look like this:

cd /pathToBinary/
./binary $@

Name the file JA and make it executable with chmod a+x JA.

Explanation: The $@ assures, that if your script is started with any arguments, they will be forwarded to the real binary.

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.