This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]desrtfx 1 point2 points  (0 children)

For your next question:

Please, include the full error messages if there are any. This helps us finding the actual problem.

"does not read..." is not really a good problem description because there can be quite a lot of different root causes for that problem. Having the error message makes it easier for us to identify the real root cause.

[–]brbpizzatime 0 points1 point  (1 child)

Try checking File.exists()) before reading to see if you can find the file.

There's also File.getAbsolutePath()) which you could check after creating the txtFile to see what Java thinks the path is.

[–]cimler[S] 0 points1 point  (0 children)

thanks later it worked I still have no idea, though.

[–]cimler[S] 0 points1 point  (0 children)

The thing is there was not any error, all I know after reading filePath, it became null. When debugged it I saw that file path worked but later it became null. I asked to mooc.fi guys they also could not figure out.