Problem with Java FileReader [duplicate]
问题 This question already has answers here : FileNotFoundException, the file exists Java [closed] (2 answers) Closed 3 years ago . Hello I have this in my code File file = new File("words.txt"); Scanner scanFile = new Scanner(new FileReader(file)); ArrayList<String> words = new ArrayList<String>(); String theWord; while (scanFile.hasNext()){ theWord = scanFile.next(); words.add(theWord); } But for some reason I am getting a java.io.FileNotFoundException I have the words.txt file in the same