File not found [Java] -


i have assignment , have couple of classes given, 1 of them filereader class, has method read files , called parameter (string) containing file path, have couple of .txt files , they're in same folder .java files thought pass along file.txt filepath (like in php, relatively) returns file not found exception!

seen fact given class should working correctly , verified classes in same folder workspace/src .java files must doing wrong filepath string, what?

private static final string filef = "file.txt"; private static final arraylist<string[]> instructionsf = creaturereader.readinstructions(filef); 

this code,

thanks help

put this:

file here = new file("."); system.out.println(here.getabsolutepath()); 

somewhere in code. print out current directory of program.

then, put file there, or change filepath.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -