dealing with non-self-contained jars?

Adam Megacz adam@megacz.com
Sun May 20 22:53:00 GMT 2007


I've noticed that a lot of Java projects have gotten in to the habit
of releasing jars that have "dangling references" to classes that are
not included.  The Apache projects seem to be particularly bad about
this.

Apparently this works because people are accustomed to using this code
in JVMs that do lazy linking, and the dangling references are in
methods which don't get called.  Unfortunately, these become a problem
when compiling with gcj -- it compiles the method bodies eagerly.

Is there a trick to getting around this?  Perhaps some flag for gcj
that says "if a method has compile-time-undefined references, just
emit code to throw an instruction where the method body ought to be"?

Or is manually fixing up the dependencies the only way to handle this?

Thanks,

  - a

-- 
PGP/GPG: 5C9F F366 C9CF 2145 E770  B1B8 EFB1 462D A146 C380



More information about the Java mailing list