It all depends on whether you are writing a Web app or just a Java app.
If you are using a Web app then you should not use
BufferedReader inputStream = new BufferedReader(new
FileReader("temp.txt"));
you have to use what Dave Wegener had suggested...something like
..getResourceAsStream(...)
But if it is just a Java standalone application, then I can provide you
the solution
Use the Run... option on the Menu bar pick Java application (New
configuration) and in the "Arguments" tab make use of the Working
directory. The default is c:\eclipse.So when u look for temp.txt the
eclipse environment will look only in c:\eclipse. Change it to "Other"
and pick from either "Workspace" or "FileSystem" or "Variable" and give
proper value where the temp.txt file is located. Now the program should
work without any problem.