General J2EE: Running a "C" program from java

  1. Running a "C" program from java (1 messages)

    I am having an exe created for a c program
    i want to invoke that from my java file.
    how do i do it ?
    Runtime.exec is not working .
    JNI needs it as a shared library right .
  2. If you have it compiled down to an executable, Runtime.exec() should work. What's happening when you call exec()?

    If you want to use JNI, you'll probably need to write JNI code that bridges your C and Java, then compile it down to a DLL (or .so in Unix).