public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bryce McKinlay <bmckinlay@gmail.com>
To: majia gm <gmmajia@gmail.com>
Cc: gcc-help@gcc.gnu.org, Java List <java@gcc.gnu.org>
Subject: Re: a question about directory structure of libjava
Date: Thu, 20 Jan 2011 09:08:00 -0000	[thread overview]
Message-ID: <AANLkTimB2tbQy3UwoMAWJh4rsa9GURK5e_FyzpS9kNR-@mail.gmail.com> (raw)
In-Reply-To: <AANLkTin+w60eM7f4LjE4v2gE2UVAL1AiExdExARtcbzT@mail.gmail.com>

On Thu, Jan 20, 2011 at 8:50 AM, majia gm <gmmajia@gmail.com> wrote:
>
> I'm new to gcj. And I'm reading the source code in the directory of
> libjava. I'm a little confused by the structure of the directory.
>
> I found that there often exists two java files, which have much
> differnce in content, having the same name in different directories.
> Such as,
>
> libjava/java/lang/Class.java
> libjava/classpath/java/lang/Class.java
>
> Will both of them be used?

The files in libjava/classpath are directly imported from the GNU
Classpath project. In some cases, such as this one, libjava overrides
classpath's classes with its own.

> I also found C++ files libjava/java/lang/Class.h, which declares the
> class Class in C++ corresponding to Class.java.
> And libjava/java/lang/natClass.cc, which implements the native methods.

Right, the .h files are generated by the gcjh tool.

>  But there's often no implementation of methods in C++.
>  Dose the method code come from the Java file? How dose this happen?

In some cases the native methods are implemented by the GNU Classpath
code in JNI (C), rather than CNI (C++). These implementations can be
found under libjava/classpath/native/jni.

Bryce

  reply	other threads:[~2011-01-20  9:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20  8:50 majia gm
2011-01-20  9:08 ` Bryce McKinlay [this message]
2011-01-20 12:42   ` majia gm
2011-01-20 13:24     ` Bryce McKinlay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimB2tbQy3UwoMAWJh4rsa9GURK5e_FyzpS9kNR-@mail.gmail.com \
    --to=bmckinlay@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gmmajia@gmail.com \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).