Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rishi M
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a word: CORBA.
 
Rick O'Shay
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic