| read write file problem [message #148882] | 
Tue, 16 March 2004 17:21   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: qwang.cs.concordia.ca 
 
I am a beginner of Eclipse. I write a simple java program 
(ReadFile.java)to read the text file. It execute normal in a tranditional 
way. However,when I copy it to Eclipse,it give me the message"the file not 
found". The text file"test.dat" ,which the program will read is  in the 
same package fold as the (ReadFile.java). For example, I have the project 
named"testfileio",package"rwfile",class"ReadFile.java", textfile"test.dat" 
is in the rwfile package also. why this happen? where should I copy the 
text file so as that it can be read? your kindly help will really 
appreciated. 
 
Linda
 |  
 |  
  | 
 | 
| Re: read write file problem [message #148902 is a reply to message #148890] | 
Tue, 16 March 2004 19:01   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Eric Bodden wrote in: 
 
> The file is always looked up in the root package. So you must refer to 
> "rwfile/test.dat". 
>  
 
I concur, note that different IDE's might take a different tack than the  
current project folder though. I always make a -Dmy.program.folder property  
to read if I want to refer to the program folder. If it's not available I  
use the current folder. Use the / at all times if possible to remain  
compatible. 
 
Maarten
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.02903 seconds