If you work in some IDEs, such as Eclipse or NetBeans, you should have this a.txt file in the root directory of your project. (and not in the folder where your .class files are created or elsewhere)
If not, you must provide an absolute path to this file.
Edit:
You will put the .txt file in the same place with .class (usually also a .java file, since you are compiling in the same folder) the compiled files if you compile it manually with javac . This is because it uses a relative path, and the path tells the JVM the path where the executable is located.
If you are using some IDE, it will generate compiled files for you using a Makefile or something similar for Windows and consider the default file structure, so it knows that the relative path starts from the project root folder.
Iulius curt
source share