LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What is the best way to call a Java program from a C prog in Linux? (https://www.linuxquestions.org/questions/programming-9/what-is-the-best-way-to-call-a-java-program-from-a-c-prog-in-linux-104825/)

renato soffiatt 10-16-2003 03:08 PM

What is the best way to call a Java program from a C prog in Linux?
 
I have a C program running in a Linux and I need to call a Java program (use a Java Interface).

Someone told me to use the system call EXEC to call the java program. But how to use it passing all the necessary parameters and also receiving the result of the operation?

Is there a way to create something like a proxy in C for a Java Interface, so that I can use the java object as it was "inside" my C program?

I am not familiar with Linux yet. I would apreciate any help.
If it possible, please, give code examples!

Very thanks
Renato

UltimaGuy 10-17-2003 07:06 AM

One approach is to use

"system (java filename)"

and then using stdin & stdout to comm. between the two apps. I have done this and it is good. This method is also found in "Thinking in java" from www.mindview.net.


All times are GMT -5. The time now is 03:05 PM.