I have a pretty dumb question, but I could not find a solution for this:
When I try to read a file, I get the error message "file not found" - this is the runtime. He compiled the file.
I am on Linux, so I use the instruction like this:
Scanner s = new Scanner(new File("home/me/java/ex.txt"));
and he gives me rror runtime:
/home/me/javaException in thread "main" java.io.FileNotFoundException: home/me/java/ex.txt (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:137) at java.util.Scanner.<init>(Scanner.java:653) at test.main(test.java:14)
I tried to change all possible things according to the file names, but nothing works.
Any clues as to why this is happening? where is java looking for default files?
java
Ajw
source share