Eclipse path problem while opening file.  
Author Message
ck





PostPosted: 2007-3-17 19:35:00 Top

java-programmer, Eclipse path problem while opening file. When ever I try to read/open '.properties' (for that matter any file)
inside my project(for example I try to open system.properties file in
HelloWorld class) it cannot open/find it.

For example if I have a project called project1 which has java source
files in
src folder then and in any of the class files I cant open any of the
files inside the
src folder. No matter where I place the file that has to be read
(inside project1 or src
or build folder) it simply gives me java.io.FileNotFoundException

Instead if I give the complete path it works. How can I read the files
relative to
my project folder without giving the complete path?
It seems that when I run my application in looks in ECLIPSE_HOME/bin
folder, for the
file being read, which of course I don't want to happen.

I am using Eclipse 3.2 (WTP), Windows XP SP2 JDK 1.5.03

Any pointers how to fix this?

 
ck





PostPosted: 2007-3-17 20:19:00 Top

java-programmer >> Eclipse path problem while opening file. On Mar 17, 4:35 pm, "ck" <email***@***.com> wrote:
> When ever I try to read/open '.properties' (for that matter any file)
> inside my project(for example I try to open system.properties file in
> HelloWorld class) it cannot open/find it.
>

It was a classpath problem in the .classpath file, I have fixed the
issue.