libgcj/2737: User-defined thrown exception is not found
Tom Tromey
tromey@redhat.com
Wed Jun 20 11:55:00 GMT 2001
>>>>> "Jeff" == jddahl <jddahl@micron.com> writes:
Jeff> I shouldn't even need the -I if I'm working in the same
Jeff> directory right? Put all the files,
Jeff> InitializationException.java, LotNumber.java, and Makefile, in
Jeff> the same directory, (which in my Makefile is SPATH) and try to
Jeff> direct the output to OPATH.
Here is my analysis of your problem.
First, your files are in package `test.core'.
They are named something like
/u/jddahl/java/sources/test/core/LotNumber.java
If you reference `InitializationException' from that class, gcj will
look for a class `test.core.InitializationException', in the class
path.
For entries in the class path which point to directories in the
filesystem, gcj will look for the file
<DIR>/test/core/InitializationException.{class,java}.
In your case, gcj has no idea that the class path ought to include
`/u/jddahl/java/sources/'. gcj simply isn't that smart; nor is any
other Java compiler that I know of (and anyway gcj is aiming for javac
compatibility in areas such as this).
So the solution to your problem is to add `-I/u/jddahl/java/sources'
to the gcj command line. This ought to make it work fine. Can you
try this?
Also, could you look at the gcj documentation and suggest changes that
might help others to avoid this confusion?
Thanks,
Tom
More information about the Gcc-bugs
mailing list