On Aug 8, 1:10 pm, Tomasz Klekner <[email protected]> wrote:
> Hi,
> I have a problem with exercise 2.3.
>
> After I create the exercise file *Code-2.32: SetSystemProperties.java* and
> the "myProperties.txt" file i still have the exception:
>
> Exception in thread "main" java.lang.RuntimeException: Uncompilable source
> code - unreported exception java.io.FileNotFoundException; must be caught or
> declared to be thrown
> at SetSystemProperties.main(SetSystemProperties.java:12)
>
> I don't know what am I doing wrong.
> I will be glad if somone will help me.
Difficult to say without the code, but I'll try:
1 - Check if you have thrown Exception in main:
public static void main(String[] args) throws Exception {
...
2 - If you put your propFile inside src, you must change the call
FileInputStream propFile = new FileInputStream(
"src/myProperties.txt");
as by default Java will search the file inside the top folder, that is
just above src (for this do not use the project view in Netbeans,
which is logical, use the Files view, which reflects the System view.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---