Calling Java object/methods from C++

R

Radha News

Hi,

I am looking for reference books/tools/code samples for calling java
objects/methods from COM/C++ classes.

I am reasonably familiar with JNI. If you have used JNI, please let me know
of your experiences and things that I need to watch out. I have used JNI 1.1
and it had several bugs and limitations especially for C++ calling Java. Is
the newer version of JNI (version 1.4) any better?

Please send your reply to my email. Thanks for your help.

Radha
(e-mail address removed)
 
E

Evan Carew

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rhdha,

Well, I knew that you could use JNI to call C/C++ code, but was unaware
that you could do the reverse with it. Also, your experience with JNI
1.1 has been experienced by many others as well. Since then, I can
assure you that things have gotten more stable.

I have a feeling that should you wish to call JAVA objects from C++,
then you will be limited to the only tool chain available I know of
which can accomplish this, the GCC tool chain. Included you will find
GCJ ( http://gcc.gnu.org/java/ ) which is capable of hosting resonably
complex JAVA legacy libraries which can then be called by your new C++ code.

As for an example, it just so happens that there is a new plugin for
Mozilla provided by the GCJ project for running applets (why you would
want to do this, I'm not sure). While this might be a little large of an
example, their list server community might in turn be able to get you
started on your way.

Radha said:
Hi,

I am looking for reference books/tools/code samples for calling java
objects/methods from COM/C++ classes.

I am reasonably familiar with JNI. If you have used JNI, please let me know
of your experiences and things that I need to watch out. I have used JNI 1.1
and it had several bugs and limitations especially for C++ calling Java. Is
the newer version of JNI (version 1.4) any better?

Please send your reply to my email. Thanks for your help.

Radha
(e-mail address removed)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAKr9uoo/Prlj9GScRAiyHAJ4qU165tYtZY6uvBuXmXNW3/SDA1wCeNC8n
+Y6zCS2HBFDGGbVv/q3JrWY=
=QEF5
-----END PGP SIGNATURE-----
 
J

Jim Sculley

Evan said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rhdha,

Well, I knew that you could use JNI to call C/C++ code, but was unaware
that you could do the reverse with it. Also, your experience with JNI
1.1 has been experienced by many others as well. Since then, I can
assure you that things have gotten more stable.

I have a feeling that should you wish to call JAVA objects from C++,
then you will be limited to the only tool chain available I know of
which can accomplish this, the GCC tool chain. Included you will find
GCJ ( http://gcc.gnu.org/java/ ) which is capable of hosting resonably
complex JAVA legacy libraries which can then be called by your new C++
code.

JNI allows any C/C++ code to call it. It is called the Invocation
Interface:

http://java.sun.com/docs/books/jni/html/invoke.html#11202



Jim S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top