interfacing c and java..
i am doing a project in c... but it needs GUI at user side....designing GUI using C language i heard that its very difficult... so i thought of doing the GUI using java program.... so now i have to interface c program and java program... please tell me anybody how to do that... and if their is any tutorial which teaches interfacing then mention it.
I was in the exact scenario as you about two weeks ago, and what I ended up doing was :
In Java :
create a new batch file
write the c program name
write the parameters you want to pass to the C Program
Execute the batch file
Have your program accept command line arguments (int argc, char **argv) and act appropriately
You definitely want to be using the JNI.
If youre using netbeans then this should get you going: http://cnd.netbeans.org/docs/jni/beginning-jni-win.html
Man... using JNI in my opinion is no less work than just slapping together a GUI. I guess it depends on the nature of the beast, so to speak. Depending on the complexity of the GUI and other elements of your program it may merit dealing with the API...