--bootclasspath overriding peer classfiles in a jar

Adam Megacz adam@megacz.com
Sat Mar 6 12:12:00 GMT 2004

Andrew Haley <aph@redhat.com> writes:
>  > I'm trying to move towards jar-at-a-time, and my first step is to get
>  > 'gcj -c foo.jar' working.  Unfortunately, it seems that if a class
>  > appears in both the bootclasspath *and* in foo.jar, then other classes
>  > in foo.jar which reference that class will get the jarred version, not
>  > the bootclasspath version.

>  >   1. Is this the intended behavior?
> Yes.  I don't understand why you would want it to do anything else.

If I put a file called java/lang/Object.class in a jarfile, Sun's VM
will not make it the ultimate superclass of all my classes.

>  >   2. If so, where should I start looking for a hack to alter this
>  >      behavior?

> I suspect that -findirect-dispatch will do what you want.

Er, I don't think we're on the same page.... I want to use the
bootclasspath to resolve method references (ie play the role of
headers in the C++ world), but the actual .o files are generated from
the corresponding .class file within the jar.

  - a

"It's lucky," he added, after a pause, "that there are such a lot of
islands in the world.  I almost envy you, Mr. Watson."

                                                   -- Mustapha Mond

More information about the Java mailing list