Hi,
I am new to
java and I am trying to load multiple files to read my data input from.
I do not want to hard code the path.
I added my file to my project directory and added following code:
String DATA_INPUT_FILE = "Input1.txt"
BufferedReader input = new BufferedReader(new FileReader(DATA_INPUT_FILE));
But I get the error:
Exception in
thread "main" java.io.FileNotFoundException: Input1 (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileReader.<init>(Unknown Source)
at com.org.RulesTest.main(Main.java:24) // this is the line where i am passing BufferedReader input = new BufferedReader(new FileReader(DATA_INPUT_FILE));
It workd when I hardcode the pathfile as :"C:\doc\file..."
Can anyone tell me why I am getting this error??Please help.
Thank you
J