This doesn't really have anything to do with JNA. Java and the VM's
underlying native code use different output streams. You'd need to
splice one into the other to get them to be synchronized in any way.
On Apr 9, 2009, at 6:29 PM, Muath A. Khalaf wrote:
Hi,
I am calling a c library from Java using JNA on Ubuntu Linux 8.04.
The problem is when I try to print
output for debugging the output of the c library itself is not
synchronized with the
Java output.
So for example if I call function printDfa(DFA* dfa) in c from
within Java as in the following code ,
(Note that dfa1, dfa2 are Java objects that encapsulate the
corresponding c structures of type DFA and printDfa calls the actual
c function printDfa.)
System.out.println("printing dfa1");
dfa1.printDfa();
System.out.println("printing dfa2");
dfa2.printDfa();
the printDfa output got mixed with the debugging messages before
and after this function.
Is there any suggested solution to this other than reimplementing
the c function in Java. Also what is the best way to debug the
java program along with the c library as a whole unit. Is there
a way to use Java debugger.
Thanks
Muath