• Post Reply Bookmark Topic Watch Topic
  • New Topic

printf() in JNI C program  RSS feed

 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I have printf() codes in JNI (Java native interface) C programs and have java programs call JNI library.
How to print out those printf() message on eclipse IDE console ?

Thanks
 
Rob Spoor
Sheriff
Posts: 21117
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can. IDEs use their own redirecting from System.out and System.err to their internal console, but any JNI program doesn't know about that.

But more importantly, why do you need to use printf inside JNI code except for debugging purposes?
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:I don't think you can. IDEs use their own redirecting from System.out and System.err to their internal console, but any JNI program doesn't know about that.

But more importantly, why do you need to use printf inside JNI code except for debugging purposes?


I got the following errors, stuck at this for days. So I thought I might be able to get some clues through printf() in JNI
#A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x610d5ef4, pid=2632, tid=6128
#
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!