Hi I am a novice in JAVA. I have been getting this file not found exception inspite of the file existing in the very location I have specified in the path which is
Initi
"C:\Workspace\conf.txt"
Those are escape sequences. You probably meant:
"C:\\Workspace\\conf.txt"
You also appear to call it config.txt
in one snippet and conf.txt
in the other?
On this line:
input = RandomAccessFile("C:\Workspace\conf.txt",'r');
You need to escape the \
's
input = RandomAccessFile("C:\\Workspace\\conf.txt",'r');
You have to escape the backslash.
input = RandomAccessFile("C:\\Workspace\\conf.txt",'r');
and also
input = new RandomAccessFile("C:\\Workspace\\conf.txt",'r');
and why you have two different filename conf.txt
and config.txt
.
Make sure the java process has permissions to read the file.