LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   can not start jar app using symlink in different directory due to file not found! (http://www.linuxquestions.org/questions/linux-software-2/can-not-start-jar-app-using-symlink-in-different-directory-due-to-file-not-found-794767/)

nocountryman 03-11-2010 01:22 PM

can not start jar app using symlink in different directory due to file not found!
 
Hi to everyone.

so i have , well a small problem.. i mean if its impossible (hate this word) i will survive ;)

anywho.. there is a website mp3skyline.com

and they have a download utility called SkyShare

so this is java app and there is one wonderful skyshare-manager.jar

nooowwww :)

i can start the app if i run it this way:

say /home/me/skymanager/bin/skyshare-manager.jar

however if say i create a symlink in a different directory (or if say create a launcher (gnome)) i get the following:

java.io.FileNotFoundException: ../res/system.cfg (No such file or directory)

it's obvious that it needs the cfg file from ../res/

and its obvious that it would be easy if you could configure it somehow in sourches..

but

there are no sources and i ran out of ideas how to work around it.

once again. its not such of a big a problem, BUT ! i just want to have a nice launcher on my panel or a symlink in my PATH so to make my life easier ;)

so... any ideas appreciated !!!

trappa01 03-12-2010 07:03 AM

Injstead of creating a symlink, have you tried creating a shellscipt that launches /home/me/skymanager/bin/skyshare-manager.jar ?

nocountryman 03-15-2010 04:07 AM

well, the thing is that i wanted to post first in the newbie zone... and the reason was : i'm n00b :)

sooooo.. if you could give an example .. i would really appreciate ;)

trappa01 03-16-2010 06:48 AM

Just create a file and add these 2 lines:

cd /home/me/skymanager/bin
./skyshare-manager.jar

make the file executable by changing its permissions ("chmod +x filename" is the quickest method but you might prefer to have a finer control).

now run your script.

If you want to respect certain customs, it is also a good idea to add this as the first line: "#!/bin/sh" (or the path to the shell that you want the script to execute under)
This not only tells the script to run in bourne shell but passes information to the "file" command, telling it that it is in fact a script.

nocountryman 03-17-2010 04:11 AM

Thanks alot mate... it really helped ;)

little by little im going to learn what there is to learn about this beautiful OS ;)


All times are GMT -5. The time now is 12:23 AM.