ayampanggang
April 15th, 2008, 07:10 AM
PS: Sorry if my title is a bit misleading. Can't find another word to describe this.
I have created a java program that reads a textfile from its relative directory, (e.g. if i place it inside /home/derek, then the textfile it wants to read should be within the /home/derek/ directory)
the problem is that when i call the java program from the right directory then it works. if i call it from somewhere else it doesn't
/home/derek #] java EntryPoint --> works! because i call it from /home/derek
/home/derek/Movies #] java -classpath "/home/derek/" EntryPoint --> doesn't work. the program runs fine but it can't find the textfile. It seems like it searches for the textfile within the /home/derek/Movies (the current working dir) instead of the home dir.
The problem is that i want to make shortcut from my Gnome desktop, and the program won't load the textfile. And for now i have to open up terminal, switch to home dir, and run it from there.
anyone can tell me how to fix this?
Thank you very much!
I have created a java program that reads a textfile from its relative directory, (e.g. if i place it inside /home/derek, then the textfile it wants to read should be within the /home/derek/ directory)
the problem is that when i call the java program from the right directory then it works. if i call it from somewhere else it doesn't
/home/derek #] java EntryPoint --> works! because i call it from /home/derek
/home/derek/Movies #] java -classpath "/home/derek/" EntryPoint --> doesn't work. the program runs fine but it can't find the textfile. It seems like it searches for the textfile within the /home/derek/Movies (the current working dir) instead of the home dir.
The problem is that i want to make shortcut from my Gnome desktop, and the program won't load the textfile. And for now i have to open up terminal, switch to home dir, and run it from there.
anyone can tell me how to fix this?
Thank you very much!