Should this work? A gij question

Tom Tromey tromey@redhat.com
Sun May 4 20:55:00 GMT 2003


>>>>> "Jeff" == VanBaalen  <jvb@uwyo.edu> writes:

Jeff> I created a simple test that involves two classes: one I
Jeff> compiled to a .o file the other I compiled to a .class
Jeff> file. Here is the class I compiled to .o

Basically what you have to do here is put the compiled code into a .so
that is named after the class it implements.  In your example this
would be "lib-Hello2.so".

This may not work in this particular case.  I haven't tried it and I
don't feel like looking at the source right now.  The problem, if
there is one, is that your class is in the unnamed package.  This is
not very interesting in general; in real code you'd use a package and
that definitely does work.

Jeff> 1. I put the directory containing  Hello2.o in my CLASSPATH variable
Jeff> and then typed

See the manual for the naming convention.

Jeff> 2. I created a jar file containing Hello.class and Hello2.o with an
Jeff> appropriate manifest and typed

This won't work.

Jeff> Should it be possible to run this "hybrid" example?

Note that interpreted code can refer to compiled code fairly easily,
but the reverse doesn't work.  This is something we hope to fix in the
future.  In the current cvs trunk it works ok, though there are some
bugs and it is fragile.  In the long term we have a plan which will
make it more robust.

Tom



More information about the Java mailing list