[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: Problem with finding a text file in Eclipse workspace

Hi

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.


Hope this helps.

Regards,
Z