libgcj/2737: User-defined thrown exception is not found
Jeff Sturm
jsturm@one-point.com
Wed Jun 20 23:21:00 GMT 2001
Tom's advice is right on, but I'm not sure he answered all of your
question:
On Wed, 20 Jun 2001, jddahl wrote:
> Is it possible to create a class, compile
> down to a .o file and continue building .o's that inherit or import that .o,
Not exactly. The compiler cannot read class information from an object
file. Object files are only for eventual inclusion in an executable (or
library).
For the compiler to find a class B needed by class A, at least one of
the following must be true:
1) A is an inner class of B (or vice versa)
2) B.java is named on the gcj command line along with A.java
3) B.class is available in the class path (or a .jar containing B.class)
4) B.java is available on the class path
It is sometimes helpful to compile in two phases, especially for larger
projects: .java -> .class followed by .java -> .o. This is how libgcj
builds itself. The main advantage of having class files available is that
gcj can parse them much faster than source files.
If you have only a few sources, compiling everything in one command might
be the best way. That way you can skip generating both class and object
files.
Jeff
More information about the Gcc-bugs
mailing list