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 Is this possible


>On Mon, 16 Apr 2001, Martin, David S wrote:
>> Now the next step is to create a C++ equivalent of the ReportsFrame.java,
>> easy right? Well I thought it was until I actually tried.

>That's not supported, and doesn't work (yet).

>> gcj -o JavaTest ReportsFrame.o libGenCAM.a JavaTest.o
>> when I execute the resulting binary I get a core dump.
>> Any Ideas?

>It crashes because the gcj runtime isn't initialized.  (If you look at the
>output of jvgenmain sometime, you'll see it calls JvRunMain instead of
>invoking the main class directly.  This function does a bit of
>housekeeping, such as creating the main thread.  It isn't documented, and
>is likely to change.)

>> Is possible to have a c++ class instantiate a java class and call methods
>> from it?

>Yes.  But you cannot replace main().

>A c++ class can make callbacks into the java runtime, provided there is
>a java class somewhere up the call stack.  That is, c++ cannot come first.

>Jeff
 
Jeff and Others,
 
Ok so I can call the java from a c++ function that gets called from a java class via a native call. But how can I remove the second Java layer so I can just call the java class from a c++ class??
 
 
 
Dave


 

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