This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Language integration
- To: Joerg Brunsmann <joerg_brunsmann at yahoo dot de>
- Subject: Re: Language integration
- From: Tom Tromey <tromey at redhat dot com>
- Date: 12 Apr 2001 11:17:40 -0600
- Cc: java at gcc dot gnu dot org
- References: <20010412101503.44881.qmail@web5407.mail.yahoo.com>
- Reply-To: tromey at redhat dot com
>>>>> "Joerg" == Joerg Brunsmann <joerg_brunsmann@yahoo.de> writes:
Joerg> int main(int argc, char **) {
Joerg> jstring jstr = JvNewStringLatin1("A");
Joerg> jclass c = ::java::lang::Class::forName(jstr);
Joerg> ::java::lang::Object *o = c->newInstance();
Joerg> a-> m();
Joerg> }
Joerg> Is this possible? Am I missing something?
This doesn't work right now. main() has to do some special
initialization stuff.
Eventually we'll write a CNI version of the invocation API. That will
let something like the above work.
If you're really interested in this you could design and implement it.
I could provide some guidance on how we'd like it to be done
(basically: more or less a CNI variant of the JNI invocation API).
Joerg> Noting that 'gij' calls the 'JvRunMain' function
Joerg> I'm asking myself what initialization must be
Joerg> run before a gcj compiled shared object can be
Joerg> used from other languages than gcj java.
Take a look at the implementation of JvRunMain. That will tell you
what has to be done.
Tom