compiling error question

Matthew R. MacIntyre matt@matty.dyndns.org
Thu Sep 20 07:00:00 GMT 2001


Hi,

I am getting a compilation error using gcj that I don't understand,
and I was hoping someone could enlighten me.

I have a class, that throws an exception, which is also in a file in
the same dir as the class.

When I do:



[matt@granger src]$ gcj -c -o Hanoi.o Hanoi.java
[matt@granger src]$



it works fine.  But when I go up one directory, and try to compile the
same file again, I get:



[matt@granger src]$ cd ..
[matt@granger foo]$ gcj -c -o src/Hanoi.o src/Hanoi.java
src/Hanoi.java:16: Class `DataNotReadyException' not found in
`throws'.
        public void solve(boolean print) throws DataNotReadyException;
                                         ^
1 error
[matt@granger foo]$ 



Can someone explain why this doesn't work?

I'm trying to get my project to run everything from a top-level
Makefile.am, rather than having Makefile.am's littered in every
directory, and this error prevents me from doing so.  Is there a way
around this?

Thanks for any help,

-matt



More information about the Java mailing list