Reputation: 7143
I am little bit new in java. I have java source in workspace /src.I created a directory /data in the same project.It means /project/src and /project/data are two directory. I would like to put same directory rather than long absolute path. How would i do it?
BufferedReader buffR1 = new BufferedReader(new FileReader(new File("../data/rural.train.txt")));
I did like this. But this is not working. I am finding file not found exception.
Upvotes: 0
Views: 1465
Reputation: 179
Two chioces:
Upvotes: 0
Reputation: 200148
Once you create a Run Configuration, go edit it and, under Arguments, set te Current directory to your data folder. Then you won't even need the ..
at the beginning of your path.
Upvotes: 1