run a program that read a text file in Jcreator

Hi all
how can I run a program that read a text file in J creator. I try to run it and I have a FileNotFound exception message.  I run it in  DOS and it work.
Is there any code I   need to write in order to run it in J creator
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 Check that the text file you are trying to read is in the directory specified when you declare the file. If you just declare dit by its file name (i.e. no absolute path) make sure that the file is in the same place with the class files.
I don't use JCreator but I know JBuilder moves the .class files to a special folder when you compile and try to execute.  So you have to make sure you add the file to your IDE environment (such as JCreator).  I don't know how to do this in JCreator but you can also do it manually.To test this go to where your JCreator project is located.  Find where JCreator puts the .class files after compiling.  Put your text file in the directory with the .class file that uses your text file.  So if you have a package it needs to be in the right package level for the compiled code.
The alternative is to hard code the exact filepath to the file.  this is less desirable for portability  but...
You do not need special code though.  the JVM just can't find your file.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JCreator creates a "classes" directory in your project directory to store the .class files. If you don't specify an absolute path for the file to read, it will read from this "classes" directory.
vnhenryAuthor Commented:
thank you all
I think that I have to create a packet to store all of the classes of my project include the textfile. so they all will have same directory.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.