JNA Invalid memory access when writing to stdout
问题 I am writing a jna wrapper for a c library, compiled using gcc under cygwin. Depending on how I execute the jna wrapper the java application either just hangs (if executed as unit test under eclipse) or terminates with an Invalid memory exception. The problem seems to occur only the the c library writes something to either stdout or stderr. Here is my minimal (not) working example: add.c #include <stdio.h> int add (int x, int y) { fprintf(stdout, "hello world\n" ); return x + y; } jna wrapper