473,516 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling Java object/methods from C++

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
kr*****@cisco.com
Jul 22 '05 #1
2 5930
-----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 News wrote:
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
kr*****@cisco.com


-----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-----
Jul 22 '05 #2
Evan Carew wrote:
-----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/h...oke.html#11202

Jim S.
--
Remove my extraneous mandibular appendages to reply via email.
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6890
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on a type mismatch. It is positively because of the boolean(java primitive)parameter. It goes fine if I change this parameter to int or String. This...
2
9739
by: Neil Cherry | last post by:
I've done a fair amount of searching on this subject and I can call my Java methods with Javascript if I use the <applet></applet> tags but when I switch over to <object></object> tags I'm not longer able to call my Java method, instead I get: Error: document.CameraViewer.setInterval is not a function How does one use the object tags and...
0
1160
by: Carlitos | last post by:
Hi there, I apologize if it is not the right forum to post this question, but it has to do with C#, HTML and javascript altogether. I programmed a windows form custom control in C# which exposes several public methods. I coded a HTML page and placed (by code) my custom control. I also placed a button on the same page. Every time I...
1
6715
by: Lakshmi | last post by:
Hi All, I am having performance issues with the .NET client calling the Java Webservice running on axis. Have detailed the problem below. Please help. I wrote a webservice in Java. Lets name this WebService1. (using Apache Axis 1.1) Scenario 1: -----------
7
3073
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything works fine. So I deploy the webservice on a remote machine (Linux box) and I get an error when calling the service. BUT: I can retrieve the WSDL and...
458
20783
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers simply aren't smart enough to understand C++? This is not merely a whimsical hypothesis. Given my experience with Java programmers --- the code they...
2
6929
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
5
6259
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is JDK 6 downloadable from http://java.sun.com/javase/downloads/index.jsp. I will be using JDK 5(update 8)
0
7276
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.