• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In a word: CORBA.
 
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic