Hey folks,
Having a bit of trouble understanding what the problem is. I created a text file that is a list of about 200 or so items, arranged one item per line as such:
item1
item2
item3
...item200
My class file FumeTracker.class is in it's own directory along with two other directories, "dat" and "profiles". The text file is saved inside the "dat" directory.
Here is the code that's throwing the exception:
import java.io.*; public class FumeTracker { public static void main(String [] args) throws IOException{ BufferedReader hr = null; try{ hr = new BufferedReader(new FileReader("//dat//herbmasterlist.txt")); String h; while((h = hr.readLine()) != null){ System.out.println(h); } }finally{ if (hr != null) hr.close(); } } }
The key here is that this program will eventually need to run on multiple systems (windows, mac or linux) and be extracted to whatever directory the user wants, as long as my directory structure remains in tact (ie my dat and profile directories must stay in the same parent directory that the executable will be in) so I don't want to hard code an absolute path.
Any suggestions on how I might get this workin? Any help is appreciated.
Thanks in advance,
~Shad