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

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)?

1
  • 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
    Commented Mar 4, 2014 at 21:31

1 Answer 1

1

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:

#!/bin/sh
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.

0

You must log in to answer this question.

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