Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » read write file problem
read write file problem [message #148882] Tue, 16 March 2004 22:21 Go to next message
Eclipse UserFriend
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 #148890 is a reply to message #148882] Tue, 16 March 2004 23:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: newsserver_mails.bodden.de

The file is always looked up in the root package. So you must refer to
"rwfile/test.dat".

Eric

linda wang maundered in <c37ukd$1tg$1@eclipse.org>

> 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

--
------------------------------------------------------------ -----
Eric Bodden
ICQ UIN: 12656220
Website: http://www.bodden.de
PGP key available
Re: read write file problem [message #148902 is a reply to message #148890] Wed, 17 March 2004 00:01 Go to previous message
Maarten Bodewes is currently offline Maarten BodewesFriend
Messages: 44
Registered: July 2009
Member
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
Previous Topic:Occurrances in file of simple text // grep a file?
Next Topic:Strange behavior when Ctrl-Left Click on symbol
Goto Forum:
  


Current Time: Sat Dec 21 17:13:53 GMT 2024

Powered by FUDForum. Page generated in 0.03684 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top