tags:

views:

168

answers:

1

I have a java application which makes use of native method calls.Is there a way to view this code in eclipse? I can get the source code for this native library, but do not know how to link in the IDE. It will also be helpful if someone tells me how to debug this native method.

+2  A: 

Not a full answer, but Eclipse does have C/C++ IDE functionality

Here is some information (though it seems a bit dated): Information on CDT/JDT integration

Info on creating JNI code from inside Eclipse (look at the very last post)

It does seem like an integrated debugging experience would be well within Eclipse's capabilities, but it's obviously not hyper important.

OK - all that said, I do have a recollection of getting Visual C++ debugger to work with a Java application that was making JNI calls... It's been awhile, but I'm pretty sure you can connect the C++ debugger to the running Java application using the pid. Then set a breakpoint, and rock and roll (you'll obviously have to compile the JNI library as a debug module).

It wasn't a fully integrated experience, but it was pretty effective. I try to write my JNI code as thin wrappers around the native calls, though, so I spend very little time debugging my JNI calls.

Kevin Day
Thanks for the information Keving
Ravisha