I am trying to read content of a file in java but I need to make it platform independent. So, I did
FileInputStream fis = new FileInputStream(new File(File.separator + "com" + File.separator + "test.txt"));
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
I am trying to run it in eclipse.
But I am getting FileNotFoundExcption
. Right now my test.txt
is in same location as my source file. Please can anyone guide me through it. Where exactly is eclipse trying to look for this file?
Thanks in advance..