Re: a question about directory structure of libjava

Bryce McKinlay <[email protected]>
Newsgroups gmane.comp.gcc.help,gmane.comp.gcc.java.devel
Message-ID <[email protected]>
On Thu, Jan 20, 2011 at 12:42 PM, majia gm <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.