| Author |
calling C programs from java
|
Steve Matthews
Greenhorn
Joined: Apr 18, 2002
Posts: 6
|
|
I am a C programmer who has recently cross trained into java. I would like to know how I can call C programs from java. What I have in mind is to create a java GUI wrapper for some rather complex C programs that I do not want to re-write in java! Any help would be appreciated, bigSteve
|
 |
Dave Vick
Ranch Hand
Joined: May 10, 2001
Posts: 3244
|
|
bigSteve Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy. Thanks again and we hope to see you around the ranch!!
|
Dave
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
Well, it all depends on what you mean by call C programs. If you are just needing to execute a program you wrote in C then you could do the following: If, however, you need to interface with your program written in C as far as getting reference to objects and/or variables etc, then you would have to use JNI. Here is a link to the JNI tutorial on Sun's Web site: http://java.sun.com/docs/books/tutorial/native1.1/index.html Hope that helps.
|
 |
 |
|
|
subject: calling C programs from java
|
|
|