This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: calling java from c++
- From: Tom Tromey <tromey at redhat dot com>
- To: akos dot szalay at sophos dot com
- Cc: java at gcc dot gnu dot org
- Date: 27 Mar 2002 10:20:09 -0700
- Subject: Re: calling java from c++
- References: <OF57E05FFE.F7428CC2-ON80256B89.0044FDEA@uk.sophos>
- Reply-to: tromey at redhat dot com
>>>>> "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