Link to home
Start Free TrialLog in
Avatar of Aixsar
Aixsar

asked on

Interfacing between Java & C++

I want to write a gui using Java and then interfacing the gui with a c++ program that will dictate what is shown in the gui. I using unix as my developing platform.

I was thinking of having two seperate processes and then using unix ipc but I'm looking for a closer relationship between the two programs. Would it be possible to link the Java and C++ code?
Avatar of expertmb
expertmb


>>Would it be possible to link the Java and C++ code?
it is possible.

JNI is a fairly rich programming interface that allows you to call native methods from a Java application.
 JNI is designed to interface with native methods written  in C or C++.
expertmb,
call native methods from a Java application.

u can call Java methods from a native app too.Its a 2 way communication.

Aixsar,
from ur login I presume that u r using AIX?
:-)
if u want any JNI links other than the standard one provided by Sun at
http://java.sun.com/docs/books/tutorial/native1.1/index.html

see these
http://www.math.tau.ac.il/system/java/jdk1.0.2/tutorial/native1.1/ 

This is one of the Best and I used it at Start and also now....
http://home.pacifier.com/~mmead/cs510jip/jni/ 

look at CodeGuru's Links to other good sites.
http://codeguru.developer.com/java/JNI/index.shtm

http://www.cs.pdx.edu/~antoy/Courses/Advanced/units/jni/ 

http://www.swtech.com/java/native/ 

this one is repeating everything they tell but for beginners it looks good.
http://herzberg1.ca.sandia.gov/JavaCourse/Java_1_1-Week5.html
hi amit(mbormann)
 
   informative  URL's
 
mb
 
how do you do?
if u want to pls contact me at amitkulz@hotmail.com

Regards
Another approach that you can take is to use CORBA. Place your  C++ in a corba object, and connect it with a java process that has the UI. You will get the two processes that you mentioned, and a more standard approach then unix ipc. You can download and compile many C++ corba orbs (try orbacus by ooc). What unix platform are you using?

I am seeing gladio first time in three months in posting a comment.
[ravindra76] You were not reading all the questions I think. I am posting comments all the time. I must say however, that there are couple of very fast answering people here (heyhey, vladi21 etc.). So,  many times when I read a question there is nothing left to say...
But I'll post more - to make you happy  ;-)
ASKER CERTIFIED SOLUTION
Avatar of Jod
Jod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
  Why not just use very simple way: FILE, and old but always usefull IPC technic? In most case ,it's simple but enough!
zhongbing, I think Aixsar has already considered this but is looking for a closer level of integration...