Friday, August 3, 2001 01:16 AM
Depends on what way you wish to interact with the C process. Use of Runtime.exec()
is fine for kicking off a C executable, but it's pretty much 'fire and forget', as the Java program does not gain any extra communication with the C process.
On the other hand, JNI offers the capability of calling API methods on a C library from Java, so the passing of information from Java to C and vice versa is much finer grained. Of course, JNI requires more work, so you need to do a requirements analysis before deciding between the two.