Re: FileNotFoundException!?
Re: FileNotFoundException!?
Thank you for your suggestion. Unfortunately, that was not the (only?) issue :(
I am using Eclipse, not sure if that matters. I am also using a Unix machine, my daughter's in fact (only relevant because the user directory is cassandra, see below lol)
This is the working directory order
/home/cassandra/workspace
contains the directory FumeTracker and a copy of herbmasterlist.txt
/home/cassandra/workspace/FumeTracker
contains the directories bin and src
/home/cassandra/workspace/FumeTracker/bin
contains the directories dat and profiles, as well as a copy of herbmasterlist.txt and
FumeTracker.class (I managed to get it to compile once by hard coding the full path)
profiles directory is empty
/home/cassandra/workspace/FumeTracker/src
contains FumeTracker.java and a copy of herbmasterlist.txt
I apologize if this is all extraneous information. There are 3 copies of my .txt file because I don't know what Java considers the home directory in a running program, so I'm not sure what the relative path should be. If it's the same directory that the class resides in, then I should be able to simply write "herbmasterlist.txt" because I have a copy in that dir as well, but that won't work either.
If I could figure out which directory the program checks when no other directories are specified in a file name, then maybe that could clue me in as to where I'm going wrong.
Thanks again in advance,
~Shad
Re: FileNotFoundException!?
Quote:
If I could figure out which directory the program checks
Salt all the possible directories with the same named file but with a different contents.
Run the program and look at the contents of the file that is read. That will tell you which file was read from where.
Re: FileNotFoundException!?
To specify the full path you must have the /home/etc... (eg '/home/cassandra/workspace/FumeTracker/myfilename') To specify a relative path, do not include the first backslash. You can backtrack to a parent directory using the ''../', to specify folders, use the '/'. For instance, if I wish to read a file in a directory found in the parent directory:
'../dir/myfile.txt'. Relative paths should be relative to the calling class...if the class is in a package, then its relative to the package.Try something like '../src/herbmasterlist.txt'