I'm pretty sure there is a simple reason for this, but after combing through google hits I can't figure it out.
Problem: I am trying to read from a .dat file I created and placed in the src folder of the java project, but eclipse doesn't recognize it.
Things I have tried, 1. refreshing project. 2. placing file manually in many places. 3.saving and restarting.
Data File
2
12087 400
7418 978
Code
import java.io.*;
import java.util.*;
public class Distance {
public static void main(String[] args) throws IOException {
Scanner q = new Scanner (new File("distance.dat"));
int count = Integer.parseInt(q.nextLine().trim());
System.out.println(count);
}
}
Package Explorer
Debug Error