libgcj/2737: User-defined thrown exception is not found
jddahl
jddahl@micron.com
Wed Jun 20 13:31:00 GMT 2001
Maybe I'm approaching this wrong. Is it possible to create a class, compile
down to a .o file and continue building .o's that inherit or import that .o,
and continue in that fashion (much like building packages with javac) or do
you skip the .o stage all together and go from many .java's to one compiled
executable?
I am running into problems after building my .o's and trying to compile them
together, but not when I compile all .java's into one executable.
Thanks,
Jeff
-----Original Message-----
From: Tom Tromey [ mailto:tromey@redhat.com ]
Sent: Wednesday, June 20, 2001 1:13 PM
To: jddahl
Cc: gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org; java-prs@gcc.gnu.org;
nobody@gcc.gnu.org
Subject: Re: libgcj/2737: User-defined thrown exception is not found
>>>>> "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