calling java from c++

Tom Tromey tromey@redhat.com
Wed Mar 27 08:45:00 GMT 2002


>>>>> "Akos" == akos szalay <akos.szalay@sophos.com> writes:

Akos> I'm trying to call java from c++ using gcj.
Akos> I thought, that the following code should work, but it coredumps
Akos> (segmentation fault) on new.
Akos> Any idea what's wrong with it ? (any workaround for this problem ?)
Akos> I'm running redhat linux 7.1

You have to use the CNI invocation API.  It isn't as simple as just
creating a Java object -- the Java runtime needs to be initialized.

The CNI invocation API won't be available until gcc 3.1 is released.
Unfortunately it doesn't seem to be documented :-(

Tom



More information about the Java mailing list