java.io.FileNotFoundException cannot locate file under src folder
<p>I can open a file (while running in Eclipse Luna on a Mac) using a <code>Scanner</code>:</p>

<pre><code>try {
    input = new Scanner(new File("./src/A-small-practice.in"));
} catch (FileNotFoundException e){
    System.out.println("ERROR: No File to read from");
}
</code></pre>

<p>... using relative path shown above. However, when I migrate it to Eclipse Neon on Windows 7, it throws a <code>FileNotFoundException</code>. I tried <code>src/</code>, <code>./src/</code>, <code>../src/</code> and <code>/src/</code>, none seems working. What should I do?</p>

<hr>

<p>Temporary solution:</p>

<pre><code>if(System.getProperty("os.name").toLowerCase().startsWith("mac os x")){
    input = new Scanner(new File("./src/A-small-practice.in"));
}
else if (System.getProperty("os.name").toLowerCase().startsWith("wind")){
    /* Absolute path  */   
}
</code></pre>