wood burning stoves*
The moose likes Java in General and the fly likes invoking C++ code from Java in a Remote AIX machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "invoking C++ code from Java in a Remote AIX machine" Watch "invoking C++ code from Java in a Remote AIX machine" New topic
Author

invoking C++ code from Java in a Remote AIX machine

Rishi M
Greenhorn

Joined: Nov 05, 2005
Posts: 18
Hi,
How can we invoke the C/C++ program deployed in a AIX server from the Java code in the Windows code ?
Also can we pass a message back from AIX box after successfull completion of the C++ code ?

Thanks,
Michael Duffy
Ranch Hand

Joined: Oct 15, 2005
Posts: 163
In a word: CORBA.


%
Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Originally posted by Rishi google:
Hi,
How can we invoke the C/C++ program deployed in a AIX server from the Java code in the Windows code ?
Also can we pass a message back from AIX box after successfull completion of the C++ code ?

Thanks,


You can invoke any native code whose binaries can support the C calling convention and that would include static C++ methods. Remote calls are a completely different problem. Direct invocation is impossible regardless of what language you use or what operating system the target host is running.

What you need is a bridge and CORBA is certainly the de facto standard for calling C/C++ from Java over the wire. This requires CORBA running on both ends. Alternatively you can write a Java proxy on AIX and use RMI or plain sockets. From there you can call your C/C++ methods using JNI. Sounds like lots of work but if you just have a few simple delegates and no CORBA it's actually rather simple.
 
Consider Paul's rocket mass heater.
 
subject: invoking C++ code from Java in a Remote AIX machine
 
Similar Threads
Problems with Ant's task javac on AIX
calling db2 stored procedure from jsp
Java Native Interface
There is no process to read data written to a pipe.
SQLException: Io exception: There is no process to read data written to a pipe.