>> 
>> Hi,
>> 
>> I'm looking for a way to call Java objects from C++.
>> Is this possible using JNI?
>
>Yes, it is possible. There are two scenarios:
>1. you want to call methods of Java objects while you are in C++ code
>that is the native implementation of a method of another Java object. In
>this case, you have to pass the object you want to call methods upon as
>a parameter to the native method.
>2. you want to execute Java code while you are in unrelated C++ code.
>Then, you have to create an instance of the Java virtual machine to
>execute the code in. This is much like calling 'java classname' from the
>command line.
>For details look at the JNI documentation - it's difficult to summarize.
>
Thanks for the info.  I would like to write a C++ container
program which hosts java server objects.  Therefore the
second choice has to be considered.  But having to create JVM in
C++ container may cause performance issue. Maybe I should rather
write the whole stuff in Java.

I will look at JNI spec.

Thanks,
Naoki




----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to