I made a java gui which takes numbers and a certain c code that perform some computation on those numbers and i wanted to mix both codes using Java Native Interface. I dont have much time and all I need is to know how a c code can be executed when a java swing button is clicked?
Asked
Active
Viewed 30 times
-2
-
1Sorry, this site does not usually provide code at short (or any) notice. – Weather Vane Jun 01 '22 at 18:42
-
1I suggest you find a good JNI tutorial online. Or, compile the C code to an exe, and launch that from Java, possibly capturing its output. – Johnny Mopp Jun 01 '22 at 18:43
-
As an alternative to JNI, maybe [`ProcessBuilder`](https://stackoverflow.com/a/20603012/230513)? – trashgod Jun 01 '22 at 18:44