Proper use of printf with JNI?

Hi,

I'm trying to print things in a native method by invoking a calling in my test main of my java program. However, the printf's in my native method are not printed to the screen until after ALL of my System.out.println calls in my main are printed to the screen (even the ones that are called AFTER the native method call). Is this normal? Is there some sort of buffer that i'm missing? How can i get my printfs to print when they are called?

Thanks!

[482 byte] By [iiq374] at [2007-9-26 6:17:18]
# 1
System.out.println() flushes the output after each call.printf() does not. So call fflush(stdout) after each printf().
jschell at 2007-7-1 15:13:22 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

i'm using java 1.4.0 beta 2 on a linux box and i could *not* get printf,

fprintf(stdout,..) fprintf(stderr,...) to show up even fflush'*** the stream after every print. the outputs don't show up at all, even after

i kill my program. (i haven't tried to see what happens if the program

just exits). i finally fopen'ed a file and printed to that, and

that works, i just have to tail -f the file. quite awkward.

tobidelbruck at 2007-7-1 15:13:22 > top of Java-index,Java HotSpot Virtual Machine,Specifications...