On Feb 16, 5:44 pm, InfinityLtd <[email protected]> wrote:
> Hello all.
>
> I followed along with the instructions in the lab for this part to
> create and read the myProperties.txt file. I'm using NetBeans 6.5. I
> created the file through NetBeans and found that it saved the file in
> the project folder ("...\SetSystemProperties\myProperties.txt"). When
> I tried to build the program, I got a "File Not Found" exception. I
> checked all of the code and it matched the text in the exercise. So I
> tried moving the myProperties.txt file into the src folder within the
> project to be with the .java file, but the program threw the exception
> again. I even tried putting in the full path and filename ("k:/.../
> myProperties.txt") but it still couldn't find it. Where is the text
> file supposed to reside or is there some other method to tell Java
> where to look for the text file?
You may place it in various places, providing that you give the
relative url to the top of the project to find it in the program.
So, you may place it (as it is done in the sample) just under the
project folder, in this case, just give the name of the file. To move
it properly use the Files tab in Netbeans.
You may also place it inside the same package as the java source. This
can be done inside Netbeans and in this case you should give as url:
src/myProperties.txt providing that you have not defined a named
package. If you have defined a named package, then the url is src/
nameofthepackage/myProperties.txt.
And so on.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---