This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Language integration


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]