473,769 Members | 1,693 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.c om
Jul 22 '05 #1
2 5942
-----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.c om


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

iD8DBQFAKr9uoo/Prlj9GScRAiyHAJ 4qU165tYtZY6uvB uXmXNW3/SDA1wCeNC8n
+Y6zCS2HBFDGGbV v/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
6928
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 inteface has a lot more methods which works fine, it is just the
2
9753
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 call Java methods? --
0
1165
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 click on the button, it calls one of
1
6741
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
3094
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 make a webreference in my VS.NET project, so obviously I (or more correct: My VS.NET project) am...
458
21434
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 write and the conversations they have --- Occam's Razor points to this explanation. For example,...
2
6966
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
6290
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
9579
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9415
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10198
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9848
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6661
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5293
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.