This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: a question about directory structure of libjava
On Thu, Jan 20, 2011 at 12:42 PM, majia gm <gmmajia@gmail.com> wrote:
> Hi, Bryce.
>
> Thanks for your reply. It's very kind of you.
>
> I'v read a little document of JNI and CNI.
>
> CNI seems to layout data such as classes and objects conforming to
> C++, so there comes the header file.
>
> ?What I'm really curious about is how the non-native methods in
> library being executed in runtime. One way I can imagine is to
> interpret the byte codes.
>
> But when I use GDB to track gij, ?I found native codes, ?source lines
> of which is in Java files of the library.
>
> Dose it mean the byte codes in library may be translated into native codes?
> ?If it is the truth, then when dose it happen?
gcj is a java-to-native-code compiler. So, the Java code in libjava is
compiled, by gcj, into a native code library, libgcj.so. libgcj.so
contains both the Java and C/C++ parts of the library. This all
happens at the time you build GCC, rather than at runtime like a
traditional JVM.
Bryce