![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how can i run java program from any where | umen | Shell Programming and Scripting | 1 | 06-12-2006 10:36 PM |
| Invoke java program in script | mpang_ | Shell Programming and Scripting | 0 | 03-27-2006 11:05 PM |
| Invoke java program in different processc d | liux99 | UNIX for Advanced & Expert Users | 1 | 08-18-2005 01:47 AM |
| executing the su command from a java program. | shailendrat | UNIX for Dummies Questions & Answers | 1 | 03-24-2005 12:27 PM |
| Java program calling a UNIX command | QUartz Ite | UNIX for Dummies Questions & Answers | 2 | 11-15-2001 09:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Communication between a java and c++ program
Hi,
I have the following problem. I have 2 programs, a java program and a c++ program. These 2 programs have to communicate with each other in full duplex mode. I want to use pipes for this communication. So when the c++ program pust something on the stdout the java program must be able to read this and the other way around. Can, or is it wise to use pipes for doing this and if it isn't, what other options do I have? thx in advance, lmnt22 |
|
||||
|
Try running the c program over jni (java native interface)
assuming you have the c++ program source code over jni methods you can put the other language directly into your java program and define interfaces so there is no need to go over stdout etc -hope this helps- :-) |
|
||||
|
Thx guys,
I discussed both methods with my collegue and we didn't choose any of both methods. One of the issues is that both programs have to be portable to almost any system. We don't realy know if windows pipe handling is the same as unix pipe handling. It pipes isn't an option. (I only found this out after I wrote the topic) Considering the small amount of time we have to complete the project we decided to implement some messeging system, which is indipendent of the method u use for in/output. For now we use 2 temp files which for each program (there are indeed 2 programs, a java program and a c program). But it might be possible to use pipes or sockets in the future. An advantage is that there doesn't have to be send much data between the 2 programs.(java is the gui and the c++ program handles the openGL drawing and heavy calculations). So we use temporary files. However I would like to thank you for your fast response! lmnt22 |
|
|||||
|
Portability to Windoze is a very significant
addition to your orignally stated problem however, you still have some options. Here's an interesting article on Linux and Win2K pipes... http://www-106.ibm.com/developerwork...,l=805,p=pipes ...and from MS... http://msdn.microsoft.com/library/de...pipes_2vqr.asp ...it may give you more ideas and options. Personally, I would recommend sockets. Enjoy ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|